Custom User

42 views
Skip to first unread message

Sachin Tiwari

unread,
Sep 30, 2014, 5:50:34 AM9/30/14
to django...@googlegroups.com
Hi 

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

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




Babatunde Akinyanmi

unread,
Sep 30, 2014, 6:15:10 AM9/30/14
to Django users

Hello Sachin,

I don't mean to be rude but Is this a question?

Sachin Tiwari

unread,
Sep 30, 2014, 6:44:21 AM9/30/14
to django...@googlegroups.com
Hi Tundebabzy,

Am I asking something wrong? please help me if possible.

Babatunde Akinyanmi

unread,
Sep 30, 2014, 8:34:18 AM9/30/14
to Django users

Your question is vague. You need to be specific about what you want to do. Let us see what you have tried and let us see the stack trace of any error.

Otherwise, your question seems like "hi, I want to build a car".

When you put in the details i can assure you that answers will start flying in.

--
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...@googlegroups.com.
To post to this group, send email to django...@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/8acd0f1e-eb98-46fa-a6b0-3fd0dd7abb4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

monoBOT

unread,
Sep 30, 2014, 9:09:19 AM9/30/14
to django...@googlegroups.com
You aren't asking anything.

--
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...@googlegroups.com.
To post to this group, send email to django...@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/8acd0f1e-eb98-46fa-a6b0-3fd0dd7abb4c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
monoBOT
Visite mi sitio(Visit my site): monobotsoft.es/blog/

Sachin Tiwari

unread,
Sep 30, 2014, 11:11:53 PM9/30/14
to django...@googlegroups.com
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:

Lachlan Musicman

unread,
Oct 1, 2014, 1:16:51 AM10/1/14
to django...@googlegroups.com
use list_display:

https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display

Cheers
L.
> --
> 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...@googlegroups.com.
> To post to this group, send email to django...@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.



--
You have to be really clever to come up with a genuinely dangerous
thought. I am disheartened that people can be clever enough to do that
and not clever enough to do the obvious thing and KEEP THEIR IDIOT
MOUTHS SHUT about it, because it is much more important to sound
intelligent when talking to your friends.
This post was STUPID.
-----------------------------------------------------------------------------------------------------------
The Most Terrifying Thought Experiment of All Time
http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html
Reply all
Reply to author
Forward
0 new messages