kers/users/forms.py

23 lines
587 B
Python
Raw Normal View History

2020-07-22 00:52:02 +02:00
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
2020-07-22 16:06:04 +02:00
from django.forms import ModelForm
2020-07-22 00:52:02 +02:00
from .models import CustomUser
class CustomUserCreationForm(UserCreationForm):
class Meta(UserCreationForm):
model = CustomUser
2020-07-22 05:03:01 +02:00
fields = ('username', 'student_number', 'real_name',)
2020-07-22 00:52:02 +02:00
class CustomUserChangeForm(UserChangeForm):
class Meta:
model = CustomUser
2020-07-22 05:03:01 +02:00
fields = ('username', 'student_number', 'real_name',)
2020-07-22 16:06:04 +02:00
class UserMetaForm(ModelForm):
class Meta:
model = CustomUser
fields = ['student_number', 'real_name']