Max Ischenko wrote:
> Alberto, Michele,
Hi Max,
>
> Thanks for your assistance.
>
No problem! ;-)
> 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:
Great, when you switch to 0.9a2 or svn keep in mind that we changed the
way you use CompoundWidget (hopefully by simplifing it), your code
should become something like this I guess:
class AddBookForm(widgets.Form):
template = 'bookswap.templates.add_book_form'
name = 'addbook'
submit_text=_(u'Add book')
widgets = ['user_fields']
def __init__(self, book_fields, extra_book_fields, **kw):
super(AddBookForm, self).__init__(name=self.name,
submit_text=self.submit_text,
fields=book_fields+extra_book_fields)
def update_data(self, d):
super(AddBookForm, self).update_data(d)
d['show_user_fields'] = not has_regular_user()
For more info:
http://trac.turbogears.org/turbogears/changeset/959
Ciao
Michele
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---