> I understand that Django maintains two parallel hierarchies of field > classes, one related to models that correspond to table columns and one > that maps these fields to forms so that they can be edited in the admin > interface. This works ok most of the time, but what if one wants to > have an alternative or additional widget associated to a field ? For > instance, say I have a "birthday" DateField that I want to render as a > date range widget in a search form ("From - Up to"). Depending on which > form fields are filled, this widget creates an appropriate field lookup > (birthday__gte, birthday__lte, birthday__range). What I did so far was > to make a DateRangeField as subclass of DateField and override the > appropriate methods. This works fine for rendering the form but breaks > several other things (e.g. in the admin interface I still want to show > the field as regular DateField widget, not a range; also the backend > knows nothing about how to map a DateRangeField to a table column). Any > ideas on how to decouple the field from its widget(s) ? > > Thanks, > George
Given that there were no replies on this, should I assume that either 1) people find the default Django form widgets adequate in all cases, or 2) they hardcode their widgets in html if they need anything more ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---