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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:22:24+00:00 2026-06-11T06:22:24+00:00

I am developing an app which extends the auth_user table, whenever any user register

  • 0

I am developing an app which extends the auth_user table, whenever any user register to the app, its one instance is created in the extended table,It works very well from simple url(manually), but when I login from admin side and add user it will also create the instance in extended table but does not show or take the user name, it just shows the blank row.

model.py code is as:

from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
class Drinker(models.Model):
       user     =models.OneToOneField(User)
       birthday =models.DateField()
       name     =models.CharField(max_length=100)

       def __unicode__(self):
             return self.name

#create our user object to attach to our drinker object

def create_drinker_user_callback(sender, instance, **kwargs):
      drinker, new=Drinker.objects.get_or_create(user=instance)
post_save.connect(create_drinker_user_callback, User)

the last 3 lines three create the instance in extended table drinker but does not shows any value just take the user_id from auth_user table. it does not take name and birthday

  • 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-06-11T06:22:26+00:00Added an answer on June 11, 2026 at 6:22 am

    You’re not populating the Drinker.name field.
    The row is blank because the unicode() method is returning nothing.

    One way to solve this would be to set it explicitly in the signal handler:

    def create_drinker_user_callback(sender, instance, **kwargs):
          drinker, new=Drinker.objects.get_or_create(user=instance, name=instance.get_full_name())
    post_save.connect(create_drinker_user_callback, User)
    

    or ditch the (possibly redundant) name field altogether and normalise it a bit:

    class Drinker(models.Model):
        user = models.OneToOneField(User)
        birthday = models.DateField()
    
        def __unicode__(self):
            return self.user.get_full_name()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing the app which has input fields and whenever user enters the controll,
I am developing an app widget that starts one activity which changes layout of
i am developing one app in which 9i have taken CustomeButtonField class for Make
I am developing one app in which I want to create two buttons. These
I am developing one app in which i need to call at particular phone
i am developing one app in which i need to show list of product
I am developing an App which has a search functionality for user's emails with
I am developing an android app which has a button in one activity and
Im developing an App which is going to be used on Samsung Galaxy SII
I am developing an app which draws more or less a two-dimensional matrix of

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.