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 9009511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:13:00+00:00 2026-06-16T02:13:00+00:00

I need to create several types of users with different permissions. I’m trying to

  • 0

I need to create several types of users with different permissions.

I’m trying to do so using proxy, but I’m not sure how to identify the resulting instances. I know that using proxy the models are in the same table in the DB, but I need to be able to identify them. For instance in the MyUser list in the admin I have all the instances created from User and MyUser model, and I’d like to have only MyUser instances.

I guess I should override the queryset method in MyUser admin, but I’m not sure what’s the best way to identify MyUser instances, or even if it’s the right way to have several user models with different permissions.

Anybody could help?

models.py

from django.db import models
from django.contrib.auth.models import User

class MyUser(User):
    class Meta:
        proxy = True

admin.py

class MyUserAdmin(admin.ModelAdmin):
    pass
admin.site.register(MyUser, MyUserAdmin)
  • 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-16T02:13:01+00:00Added an answer on June 16, 2026 at 2:13 am

    I created a group myusers, and add it to the instance when creating a MyUser object, so that I can filter them out in MyAdminUser queryset:

    class MyUser(User):
        class Meta:
            proxy = True
    
        def save(self, *args, **kwargs):
            super(MyUser, self).save(*args, **kwargs)
            self.groups.add(Group.objects.get(name='myusers'))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a set of function templates that can take different types
We need to create several SQL reports, each of which depends upon the results
I need to create several Divs dynamically, and I need to add onmouseover event
I need to create several counters for a system health check and monitoring. Since
I need to create several Raphael objects in my program. field1 and field2 are
I need to create and combine several expressions for child entity into one to
I have dynamically created WrapPanel (_wp) with several Borders. And I need create handler
For my Ruby on Rails application, I need the possibility to create several LectureNote
I need to create a single trace file that spans several days for one
I have several custom content types and in one specific one I need to

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.