Hotel/hotel/rooms/forms.py
2019-01-30 20:58:03 +01:00

24 lines
549 B
Python

from django.forms import ModelForm
from django.utils.translation import gettext_lazy as _
from .models import *
class ClientForm(ModelForm):
class Meta:
model = Client
fields = '__all__'
labels = {
'id_number': _('Numer dowodu '),
'name': _('Imię '),
'surname': _('Nazwisko ')
}
def __init__(self, *args, **kwargs):
super(ClientForm, self).__init__(*args, **kwargs)
self.fields['id_number'].error_messages = {'required': 'custom required message'}