newforms: how to validate form_for_model ?

2007-11-07 Thread parabol

Hi,
I have a form class which is generated with form_for_model. How can I
write my custom validator? I think I should set a clean() method for
that class. Is it reasonable to say that;

fom1.clean= def clean 

fkoksal


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



unique_true option of the fields works as case-sensitive, how can we make it case-insensitive?

2007-09-04 Thread parabol

When I mark a field as unique_true is works as case-sensitive and does
not catch something like "problem" and "Problem".  What is the correct
way of making it case-insensitive? Thus it will catch even "problem"
and "ProBLem".

I tried to override the save() method, but this time the thrown
exception (Integrity Error) is not catched by the admin form.

What do you suggest?


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