mercredi 30 septembre 2020

How can I make one of the fields in admin.TabularInline conditional?

Is there a way how can I make one of the fields in admin.TabularInline conditional?

for example

class ParameterInline(admin.TabularInline):
    form = ParameterForm
    fields = ["ParameterA", "ParameterB"]

What if I wanted to display the ParameterB only if something else was set to, for example, True?

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire