On Jan 4, 9:38 pm, Shawn Milochik <sh...@milochik.com> wrote:
> Hi Ondřej.
>
> ...
> #2: The validation should all be done during form validation[2], prior to 
> save. Using a Form or ModelForm. That way, the user can get friendly, useful 
> errors.

Further to this, look into model validation if the logic is integral
to the model:

http://docs.djangoproject.com/en/dev/ref/models/instances/?from=olddocs#validating-objects

I tend to put the low-level logic in there, and have the forms handle
the errors raised from the model validation, rather than packing it
all into the form (if for no other reason than sometimes objects are
not created from forms!).

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to