Alberto, Michele,
Thanks for your assistance.
The key was to use different widget "category" by putting extra fields
under a different key in self.widgets. I did not used disabled fields
but wrote small Form subclass instead and of course, a custom Kid
template. Just for the reference, my Form looks like this:
class AddBookForm(widgets.Form):
template = 'bookswap.templates.add_book_form'
name = 'addbook'
submit_text=_(u'Add book')
def __init__(self, book_fields, extra_book_fields, user_fields):
super(AddBookForm, self).__init__(name=self.name,
submit_text=self.submit_text,
fields=book_fields+extra_book_fields)
self.widgets['user_fields'] = user_fields
def update_data(self, d):
super(AddBookForm, self).update_data(d)
d['show_user_fields'] = not has_regular_user()
d['user_fields'] = self.widgets['user_fields']
Max.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---