Hi,
I’m working on a ModelForm. When a field is set to blank=False
in models.py
, the form element appears like this:
This screenshot corresponds to this in models.py
:
field1 = models.ForeignKey(
'SomeModel',
on_delete=models.CASCADE,
verbose_name='some verbose name',
related_name='some_related_name',
)
Which is how I want it to appear. However, when the model indicates blank=True (which is needed), I have this kind of placeholder default (the “---------”) that I can’t get rid of:
In models.py
:
field2 = models.CharField(
_('Some label'),
choices=Some.choices,
max_length=100,
blank=True
)
Is it possible to get the appearance of the first image on a filed where blank is set to True
?