I'm working on a custom Django CMS plugin and encountered a situation where I need nested inlines. Below are my model structures.
class Link(NavLink):
card = models.ForeignKey('CardPanel', related_name='card_links')
class CardPanel(models.Model):
title = models.CharField(max_length=50)
image = FilerImageField(null=True, blank=True, related_name="navigation_vertical_link_image")
link_description = HTMLField(blank=True, null=True, max_length=150)
button_link_internal = PageField(blank=True, null=True)
button_link_external = models.URLField(blank=True, null=True)
plugin = models.ForeignKey('Panel')
class Panel(CMSPlugin):
pass
What I ideally need is nested inlines. So as Link model has m:1 relationship with CardPanel and CardPanel has m:1 relationship with the Panel model, I want to be able to add multiple CardPanels containing multiple Link models. What is the best way achieving this through the ModelAdmin in Django?