expephalon-demomodule/core/forms/profiles.py
Klaus-Uwe Mitterer 53780751d1 Preparing files for admin profiles
Changing File models to allow user association
2020-04-16 15:22:03 +02:00

15 lines
No EOL
600 B
Python

from django.forms import ModelForm, CharField, EmailField
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from core.models import AdminProfile
class AdminEditForm(ModelForm):
#fields from User model that you want to edit
first_name = CharField(required=True, label=_('First Name'))
last_name = CharField(required=True, label=_('Last Name'))
email = EmailField(required=True, labels=_("Email Address"))
class Meta:
model = AdminProfile
fields = ('first_name', 'last_name', "email", 'mobile', "role", "image")