Hi,
with Django forms you can specify widget:
class LoginForm(forms.Form):
email = forms.CharField(
max_length = 30,
widget = forms.TextInput(
attrs = {'class':'text required email', 'id':'email'}))
password = forms.CharField(
max_length = 20,
widget = forms.PasswordInput(
attrs = {'class':'text required', 'id':'password', 'minlength':'4'}))
is it possible to do that in models?
class Order(models.Model):
name = models.CharField(max_length = 256)
phone = models.CharField(max_length = 256)
email = models.CharField(max_length = 256)
start = models.CharField(max_length = 256)
destination = models.CharField(max_length = 256)
size = models.CharField(max_length = 256)
I'd love to use this (specify CSS class) when creating form for model like:
class OrderForm(ModelForm):
class Meta:
model = Order
Thanks in advance, Etam.