Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9235913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:09:53+00:00 2026-06-18T07:09:53+00:00

I have read the definition in the official Django documentation , and I am

  • 0

I have read the definition in the official Django documentation, and I am still confused by what a Manager does.

The documentation says that they allow you to operate on database tables/models, but I still don’t understand this.

Can someone explain managers and their role to me? An answer with an example would be preferable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:09:55+00:00Added an answer on June 18, 2026 at 7:09 am

    A manager is usually something hidden away from django programmers that django uses to interface between model code and the database backend.

    When you query the django ORM, you do so through calls to

    from my_app.models import MyModel
    
    mms = MyModel.objects.all()
    

    In this case, the objects part of the function is what is returned by the manager. If you wanted MyModel to only ever get blue MyModel instances (the database might contain red models too) then you could create a manager and hack your model thus

    class BlueManager(models.Manager):
        def get_query_set(self):
            return super(BlueManager, self).get_query_set().filter(colour='Blue')
    
    class MyModel(models.Model):
         colour = models.CharField(max_length=64)
         blue_objects = BlueManager()
    

    and calling

    MyModel.blue_objects.all()
    

    would only return objects with colour as blue. Note, this is a very poor way to filter models!

    One would usually need to modify a Manager interface if they were going to modify the QuerySets that a manager would usually return or if you needed to add “table” level queries (rather than regular django “row” level). The documentation for managers is quite complete and contains several examples.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ruby newbie alert! (hey that rhymes :)) I have read the official definition but
I have read the official definition of raise, but I still don't quite understand
In the database, I have a definition table that is read from the application
I have read few articles about table partioning but still I am bit confused
How does this star unit type works? I have read msdn definition . But
I have read up on the Reachability framework and am still confused why the
I have read several documentation already but the definition of class and instance didnt
I have read the definition of UnderlyingSystemType namely that it Indicates the type provided
I noticed in the code base I have to read that sometimes property definition
I have read the Apple documentation, and many postings on the subject on SO,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.