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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:39:51+00:00 2026-06-05T08:39:51+00:00

Scenario: Let’s say I want to extend Django’s User model using multi-table inheritance. Let’s

  • 0

Scenario:

Let’s say I want to extend Django’s User model using multi-table inheritance. Let’s say the model I created for that is called CustomUser.

Now let’s assume that there are already existing records in the database corresponding to the User model and the table corresponding to the CustomUser model is still empty.

Now I want CustomUser model to be accessible from the Django’s Admin app. What I noticed is only User model records which has a corresponding record in the CustomUser table is included in the change list of CustomUser, as if an INNER JOIN is being done behind the scene in the query… (I checked using connection.queries and it was indeed an INNER JOIN).

Now I want to change this behaviour so that a LEFT JOIN is done to retrieve records pertaining to CustomerUser.

How can I achieve this in Django?

Thank you very much!

  • 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-05T08:39:53+00:00Added an answer on June 5, 2026 at 8:39 am

    Put below in any working admin.py.

    from django.contrib import admin
    from django.contrib.auth.admin import UserAdmin
    #### below imports your custom user model
    from accounts.models import CustomUser   
    
    admin.site.unregister(User)
    
    class UserProfileInline(admin.StackedInline):
        model = CustomUser   
    
    class UserProfileAdmin(UserAdmin):
        inlines = [ UserProfileInline, ]
    
    admin.site.register(User, UserProfileAdmin)
    

    Above will show your CustomUser model in User in admin. now you can access User fields from UserProfileAdmin by User__first_name etc. pardon for bad english.

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

Sidebar

Related Questions

I have the classic scenario with 2 tables and a junction table. Let's say,
Let's assume below scenario: In the multi-processor system we have, PIT that interrupt any
Let's say I have a scenario where I have a Service that is responsible
I've come across a strange scenario related to class inheritance in Objective-C. Let's say
Let's just say I have a scenario where I test signing up. After that,
My scenario is that I have a .net application (let's say a Console App)
I'm using Subclipse 1.6x plugin in Eclipse. Let me explain the scenario first: Say
Scenario 1 I have one table lets say member. In that table member i
Let's take basic scenario where I want to insert a record during user registration
Let's supose a simple scenario: a fact table F with two dimensions D1 and

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.