Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Adding new fields in ModelAdmin with fieldsets to edit user, and add_fieldsets whan creating a new user

from django.contrib.auth.admin import UserAdmin

class CustomUserAdmin(UserAdmin):
    ...
    fieldsets = UserAdmin.fieldsets + (
        (None, {'fields': ('custom_field',)}),
    )
    add_fieldsets = UserAdmin.add_fieldsets + (
        (None, {'fields': ('custom_field',)}),
    )
Comment

PREVIOUS NEXT
Code Example
Python :: print a box like the ones below 
Python :: what if init migrations run two times or by pass this migrate 
Python :: write in file python 
Python :: how to remove na values in r data frame 
Python :: Fernet: Cannot decrypt strings saved in csv with pandas 
Python :: python if boolean example 
Python :: pytorch_starting 
Python :: skip security check selenium linkedin python 
Python :: ValueError: initial_value must be specified. site:stackoverflow.com 
Python :: check labels with handles in ax 
Python :: bogo sort 
Python :: uneven chunks of array slices 
Python :: numpy loadtxt comment 
Python :: find no of iterations in python 
Python :: qcut and cut function in python stack overflow 
Python :: python pipe select where 
Python :: python move all txt files 
Python :: ternary operator using dictionary in Python 
Python :: comprehensive python cheat sheet 
Python :: pandas dexcribe only one column 
Python :: python which __divs__ are there 
Python :: python 3.10 windows 7 
Python :: nested list comprehensions 
Python :: python shift array 
Python :: python class variable 
Python :: python pandas if statement 
Python :: python check if key exist in dict 
Python :: bounding box in matplotlib 
Python :: random forest 
Python :: python re 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =