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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:46:53+00:00 2026-05-23T04:46:53+00:00

I am adding a user’s education to his userprofile. A user may have multiple

  • 0

I am adding a user’s education to his userprofile. A user may have multiple entries for his education. Should I be using a basic M2M relationship, such as —

class Education(models.Model):
    school = models.CharField(max_length=100)
    class_year = models.IntegerField(max_length=4, blank=True, null=True)
    degree = models.CharField(max_length=100, blank=True, null=True)

class UserProfile(models.Model):
    user = models.ForeignKey(User, unique=True)
    educations = models.ManyToManyField(Education)

Or should I be using a through model for this relationship? 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. Editorial Team
    Editorial Team
    2026-05-23T04:46:53+00:00Added an answer on May 23, 2026 at 4:46 am

    @manji is correct: Django will create a mapping table whether or not you use through.

    To provide an example of why you might want to add more fields to the intermediary, or through table:
    You could have a field in the through table to track whether or not that particular education represented the final school the person attended:

    class Education(models.Model):
        ...
    
    class UserProfile(models.Model):
        ...
        educations = models.ManyToManyField(Education, through='EduUsrRelation')
    
    class EducationUserRelation(models.Model):
        education = models.ForeignKey(Education)
        user_profile = models.ForeignKey(UserProfile)
        is_last_school_attended = models.BooleanField()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a user control to handle adding comments to certain business entities,
When programmatically adding user controls using LoadControl(string path), when, in the user control's page
Very weird situation going on with a FlowLayoutPanel... I have been dynamically adding user
I'm working on adding user submitted comments to a personal project. Comments have a
I am adding user control to listbox. Everything works fine but i have a
I have a UITextField added to an UIAlerView (Kind of adding user to list
I have some buttons that get disabled when adding a user. What I need
When adding user input to a web page, it should (unless it's HTML of
I'm the lead dev for Bitfighter , and am adding user-scripted bots using Lua.
I'm adding guest user functionality to my app using the guide detailed in the

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.