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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:09:56+00:00 2026-05-28T14:09:56+00:00

I extended the User model in Django by using Profiles. As you know, creating

  • 0

I extended the User model in Django by using Profiles. As you know, creating a new user doesn’t create a new profile linked to that user, so we need to add an auxiliary method, something like this:

class UserProfile(models.Model):
    user = models.OneToOneField(User)
    field_to_be_updated = models.DateTimeField(auto_now_add=True)

User.profile = property(lambda u: UserProfile.objects.get_or_create(user=u))

That works great, but I’d like to be able to call a method, say, update_a_field within the UserProfile class in such a way I could do User.objects.all[0].profile.update_a_field() or something to that effect.

I have tried to create a Manager to UserProfile class to no avail. It just doesn’t recognize the methods I attach to the class. It seems UserProfile is not a regular model in the sense it ccan’t be accesed by UserProfile.objects…

So, how can I add methods to update a UserProfile instance? Should I add a method to the User model and then access UserProfile in that way?.

  • 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-28T14:09:57+00:00Added an answer on May 28, 2026 at 2:09 pm

    I’m not sure exactly why but my experience is:

    DOES NOT WORK

    user.profile.field = "value"
    user.profile.save()
    

    DOES WORK

    profile = user.profile
    profile.field = "value"
    profile.save()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have extended Django's User Model using a custom user profile called UserExtension .
I've extended Django's contrib.auth.models user like: class UserProfile(models.Model): user = models.ForeignKey(User, related_name = 'profile')
I extended the User model in django to include several other variables, such as
When I'm trying to create an extended user profile I'm getting UserProfile object is
I have an extended UserProfile model in django: class UserProfile(models.Model): user = models.ForeignKey(User, unique=True)
Django lets you create a model foreign-keyed to User and define it in settings
I've extended the standard Django User model with a UserProfile, and created a OneToOne
I extended JDialog to create a custom dialog where the user must fill some
In my application I have an extended User model called UserProfile. This user can
I've searched similar topics but haven't found what I need.. I extended Users model

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.