kers/users/forms.py
2020-07-24 23:33:11 +02:00

26 lines
782 B
Python

from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.forms import ModelForm, TextInput
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 = ['real_name', 'student_number']
widgets = {
'real_name': TextInput(attrs={'placeholder': 'Robbe Van Herck'}),
'student_number': TextInput(attrs={'placeholder': '001700000'})
}