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

  • SEARCH
  • Home
  • 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 368553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:50:05+00:00 2026-05-12T13:50:05+00:00

I have following model: class UserProfile(models.Model): User profile model, cintains a Foreign Key, which

  • 0

I have following model:

class UserProfile(models.Model):
    """
    User profile model, cintains a Foreign Key, which links it to the
    user profile.
    """
    about = models.TextField(blank=True)
    user = models.ForeignKey(User, unique=True)
    ranking = models.IntegerField(default = 1)
    avatar = models.ImageField(upload_to="usermedia", default = 'images/js.jpg')
    updated = models.DateTimeField(auto_now=True, default=datetime.now())
    is_bot = models.BooleanField(default = False)
    is_active = models.BooleanField(default = True)
    is_free = models.BooleanField(default = True)
    objects = ProfileManager()

    def __unicode__(self):
        return u"%s profile" %self.user

And a manager

class ProfileManager(models.Manager):
    """
    Stores some additional helpers, which to get some profile data
    """
    def get_active_members(self):
        '''
        Get all people who are active
        '''
        return self.filter(is_active = True)

When, I try to call something like UserProfile.obgets.get_active_members()

I am getting the

raise AttributeError, "Manager isn't accessible via %s instances" % type.__name__

AttributeError: Manager isn’t accessible via UserProfile instances

Could you please help

  • 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-05-12T13:50:06+00:00Added an answer on May 12, 2026 at 1:50 pm

    Managers are only available on model classes and not on model instances.

    This will work:

    UserProfile.objects
    

    This will not:

    profile = UserProfile.objects.get(pk=1)
    profile.objects
    

    In other words, if you are calling it on an instance of a UserProfile, it will raise the exception you see. May you confirm how you are accessing the manager?

    From the docs:

    Managers are accessible only via model classes, rather than from model instances, to enforce a separation between “table-level” operations and “record-level” operations

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

Sidebar

Ask A Question

Stats

  • Questions 195k
  • Answers 195k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can start export as a background task. In the… May 12, 2026 at 7:03 pm
  • Editorial Team
    Editorial Team added an answer If I am reading this right then you want the… May 12, 2026 at 7:03 pm
  • Editorial Team
    Editorial Team added an answer The answer to my own question seems to be sabredav.… May 12, 2026 at 7:03 pm

Related Questions

This is probably insultingly simple and worthy of a Nelson Muntz laugh, but I'm
I have a following model: class Car(models.Model): make = models.CharField(max_length=40) mileage_limit = models.IntegerField() mileage
I have the following model class Command(models.Model): server = models.ForeignKey(Server) user_login = models.CharField(max_length=100) user_run
I have the following model : class Model extends BaseModel { public function save($conn

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.