Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2054 (closed enhancement: fixed)

Opened 11 years ago

Last modified 11 years ago

[PATCH] Mechanism to programatically choose an expose decorator in a method

Reported by: splee Owned by: splee
Priority: normal Milestone: 2.0b1
Component: TurboGears Version: trunk
Severity: normal Keywords: sprint documentation
Cc:

Description (last modified by splee) (diff)

Docstring from register_custom_template_engine in patch:

        """Registers a custom engine on the controller.
        
        Mulitple engines can be registered, but only one engine per
        custom_format.
        
        The engine is registered when @expose is used with the
        custom_format parameter and controllers render using this
        engine when the use_custom_format() function is called
        with the corresponding custom_format.

        exclude_names keeps track of a list of keys which will be
        removed from the controller's dictionary before it is loaded
        into the template.  This allows you to exclude some information
        from JSONification, and other 'automatic' engines which don't
        require a template.
        """

Attachments

custom_format.patch Download (5.1 KB) - added by splee 11 years ago.

Change History

Changed 11 years ago by splee

comment:1 Changed 11 years ago by splee

  • Description modified (diff)
  • Summary changed from Mechanism to programatically choose an expose decorator in a method to [PATCH] Mechanism to programatically choose an expose decorator in a method

comment:2 Changed 11 years ago by mramm

  • Milestone changed from 1.9.7a5 to 2.0b1

comment:3 Changed 11 years ago by mramm

  • Keywords sprint added

comment:4 Changed 11 years ago by mramm

  • Owner changed from faide to splee

comment:5 Changed 11 years ago by splee

  • Status changed from new to closed
  • Resolution set to fixed

This was committed with tests in r5917

comment:6 Changed 11 years ago by faide

  • Status changed from closed to reopened
  • Keywords documentation added
  • Resolution fixed deleted

It seems like a nice patch, this would be great to have some documentation that explains how to use it and in which kind of use case it becomes usefull.

Re-opening the ticket an setting the keyword to documentation.

comment:7 Changed 11 years ago by mramm

  • Status changed from reopened to new

comment:8 Changed 11 years ago by mramm

  • Status changed from new to closed
  • Resolution set to fixed

I'm actually going to close this ticket and add a new documentation ticket. Docs for this feature should not hold up the 2.0b1 release.

Note: See TracTickets for help on using tickets.