Well, you have to set your required fields somewhere. If you don't want them to be shown or editable in the form, your options are to set them in the view (by using a custom subclass of CreateView
) or if appropriate to your design in the save
method of the model class. Or declare an appropriate default
value on the field in the model.
It would also work to allow the fields into the form, but set them to use HiddenInput
widgets. That's not safe against malicious input, so I wouldn't do that for purely automated fields.