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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:02:47+00:00 2026-05-27T10:02:47+00:00

I am designing a week-based menu application. I am wondering if I should just

  • 0

I am designing a week-based menu application. I am wondering if I should just do this:

class MenuWeek(models.Model):
    sunday = OneToOneField("MenuDay")
    monday = OneToOneField("MenuDay")
    #etc through Saturday

class MenuDay(models.Model):
    # some stuff here, but not a foreign key to MenuWeek

instead of this:

class MenuDay(models.Model):
    week = ForeignKey("MenuWeek") # (with no OneToOne's defined in MenuWeek)

Is the first way a good way to implement a short “fixed-length” list relationship between parent and child or should i just stick with ForeignKey in the MenuDay and enforcing length through forms validation? I’m thinking the administration may be cleaner, the first way, where its clear which day of a week you are editing.

Thanks

  • 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-27T10:02:48+00:00Added an answer on May 27, 2026 at 10:02 am

    I would never use your first option. You’ll end up repeating yourself all over the place to run a particular section of code for each weekday. The second option will result in much nicer code down the road.

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

Sidebar

Related Questions

When designing both the domain-model and class-diagrams I am having some trouble understanding what
When designing a class, should logic to maintain valid state be incorporated in the
Designing code to handle transfers of objects called contractBundles. Have this in the models.py
This should be a simple one. Let's say I'm designing a very simple timeclock
While designing a table my colleague here says that I should avoid identity column
When designing a collection class, is there any reason not to implement locking privately
When designing a ASP.net WebForm application what are some important steps to take (or
I made the following function in SQL Server 2008 earlier this week that takes
Here is my problem: I am designing an application that will allow students to
I designing a polynomial class for one of my com sci courses , I

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.