It looks like you might want to create a custom Manager class. As you alluded 
to, you definitely don't want to have to assume that every function that 
touches your models is doing all the required checking.

http://docs.djangoproject.com/en/1.1/topics/db/managers/

I didn't really know what a Manager was until recently, so here's a brief 
background:

When you pull a queryset from your model using objects.all() or 
objects.filter(), you're using its default manager, which is called 'objects.' 
You can replace that with something which has more features than the normal 
ones (all(), get(), filter(), etc.), and also customize the behavior so that, 
for example, all() only pulls a screened subset.

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