Django. How to set default option use generic CreateView

Viewed 1358

Model:

class MyModel(model.Models)
   status = models.ForeignKey(Statuses, on_delete=models.PROTECT, null=True, blank=True)

Views:

class MyViewCreate(CreateView):
    model = MyModel
    form_class = MyFrom
    template_name = 'mymodel_form.html'

Forms:

class MyForm(ModelForm):

    class Meta:
        model = MyModel
        fields = '__all__'

How i can in form set default or first value on the option list >

1 Answers
Related