I have this in my model.py
class marca(models.Model):
marcas = (
('chevrolet', 'Chevrolet'),
('mazda', 'Mazda'),
('nissan', 'Nissan'),
('toyota', 'Toyota'),
('mitsubishi', 'Mitsubishi'),
)
marca = models.CharField(max_length=2, choices= marcas)
def __unicode__(self):
return self.marca
And I need to use it in my form.py
I tried this but it doesn't work.
class addVehiculoForm(forms.Form):
placa = forms.CharField(widget = forms.TextInput())
tipo = forms.CharField(max_length=2, widget=forms.Select(choices= tipos_vehiculo))
marca = forms.CharField(max_length=2, widget=forms.Select(choices= marcas))
super(CharField, self).__init__(*args, **kwargs) TypeError: __init__() got an unexpected keyword argument 'choices'
– Isoprene