Django ORM - objects.filter() vs. objects.all().filter() - which one is preferred?
Very often I see constructs like MyModel.objects.all().filter(...) which will return a QuerySet of the default Mananger. At first all() seems to be quite redundant, because MyMode.objects.filter(...) delivers the same result. However, this seems to be safe for the default Manager only, because of the following two statements in the Django documentation: Excerpt from the Chapter "Adding extra manager methods" A custom Manager method can return anything you want. It doesn’t have to return a QuerySet. Definition of the all() manager method: all() Returns a copy of the current QuerySet (or