I have a django model like below
models.py
class Product(models.Model):
name = models.CharField(max_length = 300)
descripti
Field ids should be generated automatically by django, to override other fields:
class ProductForm(ModelForm):
class Meta:
model = Product
exclude = ('updated', 'created')
def __init__(self, *args, **kwargs):
super(ProductForm, self).__init__(*args, **kwargs)
self.fields['name'].widget.attrs\
.update({
'placeholder': 'Name',
'class': 'input-calss_name'
})