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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:47:00+00:00 2026-05-21T21:47:00+00:00

I want to fetch a specific Goal through complicated logic for a certain User.

  • 0

I want to fetch a specific Goal through complicated logic for a certain User. Is this code supposed to go in the View or the Model?

If it is supposed to go in the Model, how would it be implemented, since User Model is written by Django and I can’t add methods?

I realize this is not a specific error question but it seems to be that should be a no-brainer to you, gurus and consequently should not yield vague answer.

Thanx

  • 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-21T21:47:01+00:00Added an answer on May 21, 2026 at 9:47 pm

    You could put it in the model or the view, or even do processing externally using a job/task queue like celery. In regards to the model vs. view question, I tend to prefer to put the logic into a view, especially if I need to process data from multiple models collectively. If you implement your logic as a method on your model, you can call it from a view or anywhere you might want. You could also implement caching very easily and store results on the model. Consider using AJAX to pull in the results asynchronously. You should also check the docs for info on storing additional info about a user.

    Store logic in view

    • Saves from needlessly complicating
      model
    • Might be a better approach if you need to interact with multiple models
    • Easy to implement and maintain
    • Not as flexible, can’t be reused everywhere

    Store logic on model

    • Makes it really easy to use all over your project, in views and/or scripts
    • Easy to do caching on the model
    • Potentially easy to customize the logic for a wide variety of usages through inheritance
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to fetch all the column names for specific table.. I am using
I want to assign the decimal variable "trans" to the double variable "this.Opacity". decimal
I want to fetch div element from other website . on which iam having
i only want to know that whether data is available for any specific date
I have any array $num_list = array(42=>'0',44=>'0',46=>'0',48=>'0',50=>'0',52=>'0',54=>'0',56=>'0',58=>'0',60=>'0'); and I want to change specific values
OK, here's the thing... You fetch the user's IP address and based on his/her
I want to use a temp directory that will be unique to this build.
Want to know what the stackoverflow community feels about the various free and non-free
Want my FireFox at work to be in sync with my FireFox at my
I want to loop over the contents of a text file and do a

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.