I have a controller called GenericController with a form fields
definition.

It defines certain fields, but I want to subclass it and add a couple
of fields to the subclass.  I can subclass it, and add the fields, but
only the fields in the subclass display.  e.g. in the example below,
only the two date fields display.

What am I doing wrong, here?

Thanks for any assistance.

The other question that comes to mind is if this did work, how would I
order the fields?

-Steve Bergman

==========================================


In GenericController:

==========================================

class SearchFormFields(widgets.WidgetsList):

   """Fields for search form"""

   filter_crit = TextField(label="Filter:",
                           attrs=dict(maxlength=50, size=13))

   sort_crit   = SingleSelectField(label='Sort by:',

attrs=dict(onchange='javascript:document.form.submit()'),
                           validator = validators.Int())


   sort_reversed = CheckBox(label='Reversed?',

attrs=dict(onchange='javascript:document.form.submit()'),
                                  validator=validators.Bool(),
                              )

search_form = TableForm(fields=SearchFormFields(),
                           submit_text='Submit')

============================================


In TimesheetController:

=============================================

class TimesheetSearchFormFields(GenericController.SearchFormFields):

   """
   Fields for timesheet search form
   """

   begin_date = CalendarDatePicker(label='Begin Date:',
                                format='%m%d%y',
                                attrs=dict(size=6, maxlength=6),
                                not_empty=False,
                                default=None,
                                showOthers=True,

validator=MyValidators.validDate(format='%m%d%y'))

       end_date = CalendarDatePicker(label='End Date:',
                               format='%m%d%y',
                               attrs=dict(size=6, maxlength=6,),
                               not_empty=False,
                               default=None,
                               showOthers=True,

validator=MyValidators.validDate(format='%m%d%y'))

search_form = TableForm(fields=TimesheetSearchFormFields(),
                           submit_text='Submit')


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