expephalon-kumisms/core/forms/profiles.py

15 lines
600 B
Python
Raw Normal View History

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")