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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:23:39+00:00 2026-05-18T12:23:39+00:00

I have several models inheriting from a base model. The fields in the base

  • 0

I have several models inheriting from a base model.
The fields in the base model are needed rarely, but Django keeps doing complex inner joins to retrieve those fields whenever I use any of the inherited models.
How can I tell Django to avoid this ? I only need the fields in this model rarely.

Note: maybe only(..) would work(I didn’t check), but I would need to add it in many places in the code..

  • 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-18T12:23:40+00:00Added an answer on May 18, 2026 at 12:23 pm

    Use abstract model inheritance.

    In short, setting abstract = True in the base class’ meta, makes Django using abstract inheritance, meaning each derived model will contain a copy of all the fields defined in the base model.

    By the way, one of the Django’s maintainers, Jacob Kaplan-Moss has quite a strong opinion against concrete inheritance,

    model inheritance also offers a really
    excellent opportunity to shoot
    yourself in the foot: concrete
    (multi-table) inheritance

    and again:

    I’d strongly suggest that Django users
    approach any use of concrete
    inheritance with a large dose of
    skepticism.

    Personally, I have never had to use model inheritance at all; however, after reading that blog entry, I am quite convinced in trying to avoid concrete inheritance as much as possible.

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

Sidebar

Related Questions

I have a Bike model and a Component model. Several models inherit from Component
I have several models with fields that are integers. I also have hashes that
I have several models with a date attribute and for each model I'd like
I have an Auction model with several attributes, two of which are current_auction:boolean and
Let's say I have a model called Theme, which has several attributes setting interface
I have several models whose records AND associations can have two states that must
I'm using pylons with sqlalchemy. I have several models, and found myself wrote such
I have several similar Models (ContactEmail, ContactLetter, ContactPostalcard). Each instance (record) in, say, ContactEmail,
I have several 3d models in an OpenGL ES application for iPhone and at
I have several active record models in a rails app and I would like

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.