1
與Django表單,您可以指定窗口小部件:Django的形式模型
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'}))
是有可能做到這一點的車型?
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)
我很想用這個(指定CSS類)像模型創建表單時:
class OrderForm(ModelForm):
class Meta:
model = Order
在此先感謝, 艾格。