22 lines
587 B
Python
22 lines
587 B
Python
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
|
|
from django.forms import ModelForm
|
|
|
|
from .models import CustomUser
|
|
|
|
|
|
class CustomUserCreationForm(UserCreationForm):
|
|
class Meta(UserCreationForm):
|
|
model = CustomUser
|
|
fields = ('username', 'student_number', 'real_name',)
|
|
|
|
|
|
class CustomUserChangeForm(UserChangeForm):
|
|
class Meta:
|
|
model = CustomUser
|
|
fields = ('username', 'student_number', 'real_name',)
|
|
|
|
|
|
class UserMetaForm(ModelForm):
|
|
class Meta:
|
|
model = CustomUser
|
|
fields = ['student_number', 'real_name']
|