expephalon-kumisms/core/forms/profiles.py

19 lines
No EOL
862 B
Python

from django.forms import ModelForm, CharField, BooleanField, ImageField
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from django.contrib.auth import get_user_model
from phonenumber_field.formfields import PhoneNumberField
from core.models import AdminProfile
class AdminEditForm(ModelForm):
display_name = CharField(required=False, label=_('Internal Display Name'))
mobile = PhoneNumberField(required=False, label=_('Mobile Number'))
role = CharField(required=False, label=_("Role"))
image = ImageField(required=False, label=_("Image"))
remove_image = BooleanField(required=False, label=_("Remove image from profile?"))
class Meta:
model = get_user_model()
fields = ('first_name', 'last_name', "display_name", "email", 'mobile', "role", "image", "remove_image")