Saturday, 7 September 2013

Dynamic show and hide fields in Djanggo admin panel

Dynamic show and hide fields in Djanggo admin panel

I have defined model in which one of the filed has definition:
REPEAT = (
('day', 'Daily'),
('week', 'Weekly'),
)
repeats = models.CharField('Repeat', default='day', max_length=5,
choices=REPEAT)
Also I have defined related admin model, which is responsible to show my
main model in panel.
Is possible to show and hide some fields in admin panel based on choice in
repeats field? For example in scenery when user choose 'Daily', then some
fields are not required and I want to hide them. I will be thankful for
any advices or hints.

No comments:

Post a Comment