on-internet
← Community

Dynamically change the label of an InlinePanel

Stack Overflow ·

I have a model with an InlinePanel. Can I change the label that is shown to be a field of the model underneath it, in this case the title of the Artist field, instead of just "Artist 1"? e.g. in the below example, "Artist 3" would become "Aaron Blommaert" then. My models look high level like this: class EditionPage(Page): # Fields start_date = models.DateTimeField(verbose_name=_("Start date")) end_date = models.DateField(verbose_name=_("End date")) # Panels content_panels = Page.content_panels + [ FieldRowPanel([FieldPanel("start_date"), FieldPanel("end_date")]), # TODO: find way to determine

Comments

Sign in or sign up to comment and upvote.

No comments yet.