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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:42:07+00:00 2026-05-11T03:42:07+00:00

Question regarding how to setup dbase relationships (newbie, this may be trivial) Followed the

  • 0

Question regarding how to setup dbase relationships (newbie, this may be trivial)

Followed the django tutorial (Poll, Choices); understood that 1 Poll has many Choice(s), therefore many Choice(s) point to a single Poll.

   class Poll(models.Model):       question = models.CharField(max_length=200)       ...     class Choice(models.Model):       poll = models.ForeignKey(Poll)       ...          

Question: I have a database with places, persons, etc. (mutiple tables). A subset of my tables have a similar field. I want a place to have 1+ phone_number(s). I want a person to have 1+ phone_number(s). I may want other tables to have 1+ phone_number(s).

If I followed the Poll/Choice approach, then my problem is indicated by the question marks shown below under PhoneNumber.

   class Person(models.Model):       firstname = models.CharField(max_length=20)       ...     class Place(models.Model):       description = models.CharField(max_length=200)       ...     class PhoneNumber(models.Model):       ??? = models.ForeignKey(???)       ... 

I have considered using inheritance so that both Person and Place inherit from the same base class. But I may have other fields besides phone_number for which I have a similar situation, and which span a different subset of tables. E.g.

               phone_number(s)     comments                ---------------     -------- Person         yes                 no Place          yes                 yes Contract       no                  yes ... 

Any advice on how to correctly design these types of relationships would be greatly appreciated. Thank you.

  • 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. 2026-05-11T03:42:08+00:00Added an answer on May 11, 2026 at 3:42 am

    I think you’re looking for Generic Relations. Also here

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

Sidebar

Related Questions

This question is regarding getting version directly from assembly. I have followed instructions from
I have a question regarding WMI and Storage Spaces. Setup: I have created a
(except for proxy setup!) I spent some time writing a question here regarding a
This is a Question regarding the topic of: Contributing to Open Source . Given
I have what seems to be a simple question regarding how to setup Jenkins
I'm bit of a newbie and had a basic question regarding adhering to the
my question is regarding JPA 2.0 with Hibernate, @OneToOne relationships and lazy loading. First
I am trying out moq and I have a question regarding to the Setup()
The question regarding the Umbraco CMS: I have to setup public access for particular
I have a quick question regarding translation in django. I am planing to redesign

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.