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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:41:58+00:00 2026-05-26T03:41:58+00:00

I have some fields on a model that won’t always be filled in (e.g.,

  • 0

I have some fields on a model that won’t always be filled in (e.g., the actual completion date and costs until the project is over). Because of this, I thought I’d split the model into two:

  1. Model #1: Dense table containing frequently searched and always completed fields
  2. Model #2: Sparse table containing infrequently searched and not always completed fields

Questions

  1. Am I thinking correctly in splitting this into two models/tables?
  2. Should I use Django’s Multi-table Inheritance, or should I explicitly define a OneToOneField? Why?

Configuration

  • Django version 1.3.1

Models

Using Django’s Multi-table Inheritance

class Project(models.Model):
    project_number = models.SlugField(max_length=5, blank=False,
            primary_key=True)
    budgeted_costs = models.DecimalField(max_digits=10, decimal_places=2)

class ProjectExtendedInformation(Project):
    submitted_on = models.DateField(auto_now_add=True)
    actual_completion_date = models.DateField(blank=True, null=True)
    actual_project_costs = models.DecimalField(max_digits=10, decimal_places=2,
            blank=True, null=True)

Using an Explicit OneToOneField

class Project(models.Model):
    project_number = models.SlugField(max_length=5, blank=False,
            primary_key=True)
    budgeted_costs = models.DecimalField(max_digits=10, decimal_places=2)

class ProjectExtendedInformation(models.Model):
    project = models.OneToOneField(CapExProject, primary_key=True)
    submitted_on = models.DateField(auto_now_add=True)
    actual_completion_date = models.DateField(blank=True, null=True)
    actual_project_costs = models.DecimalField(max_digits=10, decimal_places=2,
            blank=True, null=True)
  • 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-26T03:41:58+00:00Added an answer on May 26, 2026 at 3:41 am

    You’re essentially dealing with apples and apples here. Django’s implementation of MTI (multi-table inheritance) uses an implicit OneToOneField.

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

Sidebar

Related Questions

I have some fields in a model that are ManyToMany, I want the ManyToMany
I have a Django model with some fields that have default values specified. I
I have a model with some fields. I have a model form that represents
I have model Article it has field title with some text that may contain
I have a basic model in which i have specified some of the fields
I have some char() fields in a DBF table that were left encrypted by
I have table with some fields that the value will be 1 0. This
Say you have a web form with some fields that you want to validate
Hi I have an user model and I also have some fields for their
I have a user model that can follow some tags User has_many :tag_followings has_many

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.