Quering

Whether a query method should go on a model or rather than to the manager depends on how many instances it effects.

Query method that affects a single instance of an object belong as a model method.

If it affects any number of them, then it should perhaps go on the manager (or even the queryset; django-model-utils PassThroughManager)


Tags: django model queries

Edit this page
Wiki-logo