On 1/13/07, Elvelind Grandin <[EMAIL PROTECTED]> wrote:
> >
> > @new_expose(template="foo", widgets={....})
> > def do_something(...):
> >      # do something
> >      return view_agnostic_data
> >
> > Sounds reasonable?
>
> Couldn't that be added to the current expose decorator too? no need
> for switching over to page widgets just for that.
>

This is what I was trying to get across.

@expose(template="path.to.template")
@widgets({...})
def index(self):
    return dict(foo="bar")

Then, if a template is being used the widgets get put into the
template namespace and if a template isn't being used, no widgets.  It
doesn't even need to be very complex, it can just update the returned
dict with the widgets.

A function that could be used in a controller method might be nice too
to enable a developer to choose widgets within the controller -
something similar to turbogears.flash() maybe that adds info to the
request object?  I'm just brain storming now though. :)

-- 
Lee McFadden

blog: http://www.splee.co.uk
work: http://fireflisystems.com
skype: fireflisystems

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to