class Label(models.Model):
name = ...
slug_name = ...
and here is the form I created straightly from model
class LabelForm(models.Model):
class Meta:
model = Label
How can I give url the widget HiddenInput? slug_name also cannot be blank because it is required…
Thanks
For the required field, use the
blankfield option with aTextField:For the
HiddenInputwidget, I assume there exists a url field in your model (which is not the case in the code you posted) check Django’s own guide to overriding the default field types or widgets on aModelForm: