Hey all,

I'm sure this is really easy to do but I can't figure out how to make
it work.  In the TG application I am working on I have various
privileged levels (admin/approver etc..),  so depending on the level
of user logged in I want different widget form content to show.  For
example:

class approver_fields(widgets.WidgetsList):
    name = widgets.TextField(validator=validators.NotEmpty)
    approved = widgets.TextField(validator=validators.NotEmpty)

approver_form=widgets.TableForm(fields=approver_fields())

class admin_fields(widgets.WidgetsList):
    name = widgets.TextField(validator=validators.NotEmpty)
    secret = widgets.TextField(validator=validators.NotEmpty)

admin_form=widgets.TableForm(fields=admin_fields())

Is there some way I can make a common_fields subclass that I can then
reuse in both of the approver_fields and admin_fields?  Basically I
want to pull out "name" so I don't have to repeat it for each widget.

Thanks for the ideas!


--~--~---------~--~----~------------~-------~--~----~
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