Thanks, Phil! That works perfectly.

The only thing that feels awkward about Django's models is that the
attributes feel like a mixture of stuff that belongs to the view and
stuff that belongs to the model (blank=True, null=True anybody?). But
that's about the only small complaint I have about Django.

After returning to Django now I remember again what was so cool about
it: the community around it. :)

Thanks, everyone!
2B

PS: I'm using this widget: http://www.djangosnippets.org/snippets/391/

On Apr 20, 12:19 pm, "Phil Davis" <[EMAIL PROTECTED]> wrote:
> On 20/04/2008, Berco Beute <[EMAIL PROTECTED]> wrote:
> If you only want to change the widget type for a field you can just
> modify the form
> after creating it or do it in the __init__ method. This has the
> benefit of not having
> to repeat the label/required information in 2 places (model and form):
>
>     #forms.py
>    class EventForm(forms.ModelForm):
>
>       def __init__(self, *args, **kwargs):
>           super(EventForm, , self).__init__(*args, **kwargs)
>           self.fields['endDate'].widget = DateTimeWidget()
>
>      class Meta:
>           model = Event
>
> --
> Phil Davis
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to