Hacker News new | ask | show | jobs
by ldite 4518 days ago
If it's a complex query of some sort, create a query repository that returns model objects rather than a "fat" static method on the model itself.

I believe that the "Django way" of doing that is to have a custom "Manager" class;

https://docs.djangoproject.com/en/1.6/topics/db/managers/#cu... http://zmsmith.com/2010/04/using-custom-django-querysets/