Tuesday, September 30, 2014

Re: Custom User

Ok sorry for incomplete description, I added a field  phone number in user profile  for eg  when we click on add user button it will show username, password and in my case it will show phone number also  but it will not be displayed after saving it. 

I add 
from django.contrib.auth.models import User    class Employee(models.Model):      user = models.OneToOneField(User)      phone_no = models.IntegerField(max_length=10)
This code in admin.py
class EmployeeInline(admin.StackedInline):      model = Employee      can_delete = False      verbose_name_plural = 'phon_no'    # Define a new User admin  class UserAdmin(UserAdmin):      inlines = (EmployeeInline, )    # Re-register UserAdmin  admin.site.unregister(User)  admin.site.register(User, UserAdmin)
Now I want to show it with main users list page.


On Tuesday, September 30, 2014 3:20:34 PM UTC+5:30, Sachin Tiwari wrote:
Hi 

I want to display a phone number field at users list page,

Username  emailAddress  FirstName  LastName       staffstatus  PhoneNumber
sachin          abc@g.com     sachin        tiwari              True            00000000000




--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b8afc4e7-9537-466b-9a2b-21047c2476bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment