Open jackh-step opened 2 months ago
Hi @jackh-step please provide a sample code with just Model and ModelAdmin. Thanks
Hi @abidibo, thanks for responding, here's an example for reproduction.
class MyModel(models.Model):
field = models.BooleanField()
hidden_field = models.BooleanField()
class MyModelForm(forms.ModelForm):
class Meta:
model = models.MyModel
fields = "__all__"
widgets = {
"hidden_field": forms.HiddenInput()
}
@admin.register(MyModel)
class MyModelAdmin(admin.ModelAdmin):
form = MyModelForm
In the above admin, even though the bottom row only contains a hidden input, it is still displayed for the reasons mentioned previously. The "hidden" class is applied if a fieldset's line has has_visible_field set to False, link to fieldset template.
Rows containing only hidden inputs in admin forms are being displayed despite having the "hidden" class. This is related to "base.css" file containing the "hidden" class selector being shadowed.