Andres Luga wrote:
> when displaying a form for a new object, I'm trying to set a default
> value for a date field using a filter in a template, like so:
>
> <form action="." method="post">
> {{ form.somefield|date:"Y-m-d" }}
>
> This gives me an error:
> 'FormFieldWrapper' object has no attribute 'year'.
> What am I doing wrong (I'm using generic views)?

The date filter only works on datetime.Date objects.  form.somefield is
a FormFieldWrapper object that prints out the html for a form input
field, and is not a Date object.


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

Reply via email to