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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:46:02+00:00 2026-05-15T02:46:02+00:00

I’ve implemented a UserProfile model (as the Django 1.2 docs say is the proper

  • 0

I’ve implemented a UserProfile model (as the Django 1.2 docs say is the proper way to save additional data about a User) which has a ‘remaining_vacation_hours’ field.

In our current system, when a user fills out a Time Off Request, the remaining hours available should be checked to see that they have enough vacation to use, or otherwise be warned that they are asking for more than they have.

Of course, vacation hours are annually replenished, so it would be appropriate for the system to check if the user would have additional vacation accrued for the dates they’re asking off.

Simply creating a get_remaining_vacation_hours() method would suffice, because other calculations or business logic that might need to be added in the future could be added to or called from that method.

My question is, does it sound correct that the get_remaining_vacation_hours() method be added to the UserProfile model?

It seems to make sense, but I wanted to verify with the community that I wasn’t overlooking a better practice for this type of thing. Any ideas or suggestions are welcome.

  • 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-15T02:46:03+00:00Added an answer on May 15, 2026 at 2:46 am

    First, I would suggest the solution of making a different method (as you’ve already suggested), but on a different class and pass the user instance as a parameter. That way, your user isn’t characterized by something that might not apply to everyone at that level of abstraction. Consider, for example, potential employees, auditors, partners, contractors, or other types of users.

    If you’re system will never have users as such (or least very few), then I echo lazerscience’s answer. In my experience, even well-seasoned programmers with great design experience tend to vary on what kind of information and behavior should go into the user profile. Trust your gut. If it “feels” like it might not be a source of pain or confusion then go for it. See also: Jeff Atwood’s advice in matters such as these.

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

Sidebar

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.