expephalon/core/forms/profiles.py
Klaus-Uwe Mitterer 853a49abe8 Implement brands
More administration pages *whoop-whoop*
2020-05-31 14:08:26 +02:00

27 lines
No EOL
1.2 KiB
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
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")
class AdminCreateForm(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"))
class Meta:
model = get_user_model()
fields = ('first_name', 'last_name', "display_name", "email", 'mobile', "role", "image")