IdHub/idhub/admin/forms.py

26 lines
561 B
Python
Raw Normal View History

2023-10-13 11:37:26 +00:00
from django import forms
from django.contrib.auth.models import User
class ProfileForm(forms.ModelForm):
2023-10-13 19:04:44 +00:00
MANDATORY_FIELDS = ['first_name', 'last_name', 'email', 'username']
2023-10-13 11:37:26 +00:00
class Meta:
model = User
2023-10-16 17:08:18 +00:00
fields = ('first_name', 'last_name', 'email')
class MembershipForm(forms.ModelForm):
MANDATORY_FIELDS = ['type']
2023-10-17 11:40:34 +00:00
class RolForm(forms.ModelForm):
MANDATORY_FIELDS = ['name']
2023-10-17 13:49:56 +00:00
class ServiceForm(forms.ModelForm):
MANDATORY_FIELDS = ['domain', 'rol']
2023-10-17 15:42:48 +00:00
class UserRolForm(forms.ModelForm):
MANDATORY_FIELDS = ['service']