On 02/05/2011 01:38 PM, Axel Bock wrote:
Shawn,
thanks for hint, I'll give that a try. Also I have some questions, for
my own clarification of things:
1) using your method - would is_valid() retur true then?
Yes, is_valid should end up true.
2) in my form display I should hide the "takeoff" field then, correct?
Yes. No reason to display it. You could even add it to the 'exclude'
list in the form's meta info. If you do that, then instead of manually
setting the cleaned_data in your clean_takeoff_str function, you could
just set self.instance.takeoff to that value, which will be saved on
form.save().
3) I alredy tried to override clean_takeoff() - it didn't get called.
Any ideas, why?
I'd have to look into Django's source, but I'm assuming that Django
validates the field first, and since it's not a valid value for the
field type (datetime) it raises a validation error before it gets that far.
Axel.
Shawn
--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.