Top "Django-managers" questions

A Manager is the interface through which database query operations are provided to Django models.

When should I use a custom Manager versus a custom QuerySet in Django?

In Django, custom managers are a great way to organize reusable query logic. The Django documentation on Custom managers says: …

python django orm django-managers
Convert django RawQuerySet to Queryset

I have 2 Django models, ModelA with an ArrayField that is used to store a large list of primary key values (…

python django postgresql django-models django-managers
Django ORM. Joining subquery

I have a table which contains list of some web sites and a table with statistics of them. class Site(…

django join left-join django-orm django-managers
Django: "Unknown Column" when run makemigrations on an app after adding an Integer Field

First of all, I have recently upgraded from Django 1.6 to 1.8, and never used South, so I'm new to migrations. I …

mysql django python-2.7 django-migrations django-managers
User manager methods create() and create_user()

I have encountered with some suspicious behavior of create() method of User object manager. Looks like password field isn't required …

django django-users django-managers
How does use_for_related_fields work in Django?

I'm unable to grasp that from the docs. It's totally unclear to me, more specifically: Is it a global setting? …

python django django-models foreign-key-relationship django-managers
How to use custom managers in chain queries?

I made a custom manager that has to randomize my query: class RandomManager(models.Manager): def randomize(self): count = self.…

django django-queryset django-managers
Is timezone.now().date a function or a callable?

I'm writing a manager in Django 1.5. I want to return a QuerySet that contains objects with a start date either …

django function callback django-managers