IdHub/idhub/admin/forms.py

32 lines
661 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
2023-10-19 13:20:06 +00:00
from idhub.models import Rol
2023-10-13 11:37:26 +00:00
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-19 13:20:06 +00:00
2023-10-17 15:42:48 +00:00
class UserRolForm(forms.ModelForm):
MANDATORY_FIELDS = ['service']
2023-10-22 18:01:41 +00:00
class SchemaForm(forms.Form):
file_template = forms.FileField()