the verbose_name I set for a ManyToManyField is not displayed in my admin. Is that because I override the form? Anybody can help?
Thanks!
models.py
class PC(models.Model):
#...
mag_blacklist = models.ManyToManyField(Magasin, verbose_name="test")
admin.py
class PCForm(forms.ModelForm):
mag_blacklist = forms.ModelMultipleChoiceField(queryset=Magasin.objects.all(), widget=forms.CheckboxSelectMultiple())
Yep, I am pretty much sure thats why! just change the label in your form field then:
mag_blacklist = forms.ModelMultipleChoiceField(queryset=Magasin.objects.all(), widget=forms.CheckboxSelectMultiple(), label="test")
Or you can get the actual verbose like this:
mag_blacklist = forms.ModelMultipleChoiceField(queryset=Magasin.objects.all(), widget=forms.CheckboxSelectMultiple(), label=Magasin._meta.get_field_by_name('mag_blacklist')[0].verbose_name)
try it out! lemme know if works