Thursday, September 30, 2010

Re: Can you make a subclass of a model just to alter behavior?

>
> Hmm.. I can't think of any caveats off the top of my head. Did you try that?
> The only thing that smells a little like trouble to me is setting a
> default manager.

If you create a custom manager, then add it to each model as "objects," then it'll be the default (and only) manager and any code that expects a manager to be named 'objects' will work seamlessly.

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment