Edit labels on form fields

This commit is contained in:
Jan Tuomi
2017-10-16 18:11:33 +03:00
parent ce1cd1b890
commit f531b39587
5 changed files with 29 additions and 10 deletions
+3
View File
@@ -22,6 +22,9 @@ class KaehmyForm_Form(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(KaehmyForm_Form, self).__init__(*args, **kwargs)
self.fields["email"].label = _('Email (not public)')
self.fields["phone_number"].label = _('Phone number (not public)')
custom_roles_exist = CustomKaehmyRole.objects.all().exists()
self.fields["custom_roles"].widget = forms.widgets.CheckboxSelectMultiple() if custom_roles_exist else forms.HiddenInput()
self.fields["custom_roles"].help_text = ""