15 lines
600 B
Python
15 lines
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")
|