The way I generally do this type of thing 
is: https://gist.github.com/1591723

Lately, I've been using model validation: the clean() method instead of the 
save() method, but I can't remember if this is always called.

https://docs.djangoproject.com/en/dev/ref/models/instances/#validating-objects

The other thing you can do is have a pre_save signal listener. That might 
be useful if you have several classes that need to have the same check done.

https://docs.djangoproject.com/en/dev/ref/signals/#pre-save

Regards,

Matt.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/CRw399vSaLIJ.
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.

Reply via email to