Django Manager Chaining

See this snippet on Djangosnippets: http://djangosnippets.org/snippets/734/

Instead of putting your custom methods in a manager, you subclass the queryset itself. It’s very easy and works perfectly. The only issue I’ve had is with model inheritance, you always have to define the manager in model subclasses (just: “objects = QuerySetManager()” in the subclass), even though they will inherit the queryset. This will make more sense once you are using QuerySetManager.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)