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 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 just want to fetch all tweets of an specific twitter account. I want
I want to fetch the user groups and want to list them but I
i Want to fetch this data using json decode. Please Help.. So far i
I just want to fetch all tweets of an specific twitter account. I want
When I fetch a specific record from db table, I want to fetch the
I want to fetch some specific rows from MySQL database using multiple ids, for
In my app, I want to fetch all videos of logged in user i.e.
How can i add pass Model-Specific urls to the Template. Let's say, i want
I want to fetch all the column names for specific table.. I am using
Hey there, I want to fetch / display the MAU of a specific Facebook

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.