How to make the admin not have a profile created. I have a Profile, Relationships one to one model and want to exclude admin.
Related
I have a User class, and each user has a PersonalInformation model and a Profile model.
In my admin panel I have:
AUTHENTICATION AND AUTHORIZATION
Users
Groups
USERS
Profiles
Personal Informations
Users have a ONE-ONE relationship with 'PersonalInformation' and 'Profile', but the two models do not have a relationship.
So I can view the Users, the PersonalInformation and Profile models separately, but I want to join them so I can view all one users information on one page.
Thank you.
I want to add more fields to django built in admin user model. How can I achieve it?
Actually , There are three users on django server, student , teacher and parent. And by adding a 'role' field to user model, I can identify which type of user is log-ged in . So how can I extend the model field.
I'm expecting to identify different role of users in login.
I want to add a column to django auth_user table. But I do not want to create a new table.
As the document peovided for extending User model, there are four ways.
proxy model
Add a oneToOne field
Creating a Custom User Model Extending AbstractUser
Creating a Custom User Model Extending AbstractBaseUser
It works some time. But How could I add a field to the auth user model it provied?
Item has foreign key to User and User has OneToOne to Profile.
I have admin for Profile. How can I show all items as inlines?
I do not have foreign key from Profile to Item, so I need something like user__itemset but it seems it can't be used in Django admin.
Hello I am very new to Django, and I am making an app that stores a lot of information about the user. But django's auth app stores only a bit of information about the user. Is there any way I can create my own model "User" and make Django's auth app use this model. Thanks.
This has been supported since Django 1.5, and is fully covered in the documentation.
Basically, you need to subclass auth.models.AbstractUser, and set the AUTH_USER_MODEL setting to point to your new model.
You can solves your problem with UserProfile model. And you can store the user extra information in this with relation of onetone or ForeignKey with unique property field.
Django user profile
U can multi-table inheritance the user model
from django.contrib.auth import User
class MyUser(User):
//add ur required fields
Reference for in heritance.