Thanks Chris!  TG seems to have a lot of little jewels like that.

On Nov 29, 1:30 pm, Christopher Arndt <[EMAIL PROTECTED]> wrote:
> Matt Wilson wrote:
> > Here's how it works.  First I make my_state_factory that builds an
> > object that has those values:
>
> >     def my_state_factory():
>
> >         class StateBlob(object):
> >             pass
>
> >         sb = StateBlob()
> >         sb.u = identity.current.user
> >         sb.hospital = u.hospital
>
> Instead of this, you could also write:
>
> from turbogears.util import Bunch
>
> def my_state_factory():
>     return Bunch(u=identity.current.user, hospital=u.hospital)
>
> Hth, Chris
--~--~---------~--~----~------------~-------~--~----~
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