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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:44:06+00:00 2026-06-08T03:44:06+00:00

I have a record keeping system that consists of two models. One model creates

  • 0

I have a record keeping system that consists of two models. One model creates a holding page and the other creates individual entries…

class RecordEntry(models.Model):
    client = models.CharField(max_length=50, choices=CLIENT_CHOICES)
    job_number = models.CharField(max_length=30, unique=False, blank=False, null=False)
    cell_number = models.CharField(max_length=4, unique=False, blank=True, null=True)
    entry_title = models.CharField(max_length=64, unique=False, blank=True, null=True)
    date = models.DateField(("Date"), default=datetime.date.today)
    attachment = models.FileField(upload_to=content_file_name, blank=True, null=True)
    ...     

class RecordPage(models.Model):
    client = models.CharField(max_length=50, choices=CLIENT_CHOICES)
    job_number = models.CharField(max_length=30, unique=True, blank=False, null=False)
    job_name = models.CharField(max_length=64, unique=False, blank=False, null=False)
    create_date = models.DateField(("Date"), default=datetime.date.today)
    contact = models.ForeignKey(UserProfile)
    entry = models.ForeignKey(RecordEntry, blank=True, null=True)
    ...

…where the page might be #211211
and the individual entries might be #211211-01, #211211-02, #211211-03

For simplicity, I’m using the forms rendered in admin to create the pages. It’s convenient because the admin gives me the “plus” icon that allows me to create and add an entry on the fly. My problem is, I’d like to be able to add as many “entries” to the page as I need. I mean, to get multiple “entry” fields on a form I could do something like:

class RecordPage(models.Model):
    client = models.CharField(max_length=50, choices=CLIENT_CHOICES)
    job_number = models.CharField(max_length=30, unique=True, blank=False, null=False)
    job_name = models.CharField(max_length=64, unique=False, blank=False, null=False)
    create_date = models.DateField(("Date"), default=datetime.date.today)
    contact = models.ForeignKey(UserProfile)
    entry = models.ForeignKey(RecordEntry, blank=True, null=True)
    entry2 = models.ForeignKey(RecordEntry, related_name='+', blank=True, null=True)
    entry3 = models.ForeignKey(RecordEntry, related_name='+', blank=True, null=True)
    entry4 = models.ForeignKey(RecordEntry, related_name='+', blank=True, null=True)
    entry5 = models.ForeignKey(RecordEntry, related_name='+', blank=True, null=True)
    entry6 = models.ForeignKey(RecordEntry, related_name='+', blank=True, null=True)
    entry7 = models.ForeignKey(RecordEntry, related_name='+', blank=True, null=True)
    and so on…

but there has to be a better way, right?

  • 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-08T03:44:10+00:00Added an answer on June 8, 2026 at 3:44 am

    why don’t use ManyToManyField here

    entry = models.ManyToManyField('RecordEntry', related_name='pages')
    

    And Django admin will automatically gives you the ability to add new rows.

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

Sidebar

Related Questions

I have two tables, users and hra. A user can only have one record
I have a record that came from the follow linq query: using (var context
For all my data in the GAE Datastore I have a model for keeping
Imagine to have a Desktop application - could be best described as record keeping
Let's say I have the following data model, for keeping track of the stats
I have the following multi-table inheritance situation: from django.db import Models class Partner(models.Model): #
I have the following models (I left out def __unicode__(...) for clarity): class Person(models.Model):
I've been chasing my tail on this one. I have a single table (keeping
If i already have record with the exact same data in mysql database i
I have a record set with hundreds of rows. when a user clicks 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.