Created a new project from the Django Cookiecutter template. It already has a customized user model.
Added new props:
from homes.models import Homes class User(AbstractUser): name = CharField(_("Name of User"), blank=True, max_length=255) homes = models.ForeignKey(Homes, on_delete=models.CASCADE, blank=True) In admin.py added:
list_display = ["username", "name", "is_superuser", "homes"] Full code:
@admin.register(User) class UserAdmin(auth_admin.UserAdmin): form = UserChangeForm add_form = UserCreationForm fieldsets = (("User", {"fields": ("name",)}),) + auth_admin.UserAdmin.fieldsets list_display = ["username", "name", "is_superuser"] search_fields = ["name"] This field is in the list of objects, and when editing from the admin it is not. What can be wrong?