Why are Manager and QuerySet not the same?

One of the questions that has been bothering me for a long time is why are Manager and QuerySet not the same?
I know that Manager returns an object from QuerySet and QuerySet methods are iterable but Manager methods are not, but I still haven’t been able to understand the reason for creating Managers

According to what I saw in the Django core code, Manager is created from a QuerySet:

class Manager(BaseManager.from_queryset(QuerySet)):
    pass

The document says that Manager is an abstraction layer between our Python code and database objects
I don’t understand the reason for creating this abstraction layer, so I have a few questions:

  1. What is the reason for using this abstraction layer?

  2. When should I overwrite Managers and when should I overwrite QuerySets?

  3. Considering the answers to the questions above, what is the difference between the two? (They may be no different and complement each other’s work, but what is the difference between what they do?)

1 Like

I’d love to hear everyones thoughts on this, as im also a bit confused about the differences and use cases!

Welcome @Mahdiashtian !

This is a duplicate topic.

See the thread at Why aren't Managers and QuerySets one thing?

Please continue the conversation in that thread.