I'm creating a custom plugin for a carousel, having two models: Gallery and Picture. Here's what the models look like:
class Gallery(models.Model):
name = models.CharField(max_length=30)
def __unicode__(self): # Python 3: def __str__(self):
return self.name
class Picture(models.Model):
gallery = models.ForeignKey(Gallery)
image = models.ImageField(upload_to="uploads/images/")
title = models.CharField(max_length=30, null=True, blank=True)
tagline = models.CharField(max_length=30)
description = models.CharField(max_length=100)
page_link = PageField(related_name="Page", null=True, blank=True)
class GalleryPlugin(CMSPlugin):
name = _("Gallery Plugin")
gallery = models.ForeignKey(Gallery)
def copy_relations(self, oldinstance):
self.sections = oldinstance.sections.all()
The problem is that I can't figure out how the admin could edit the Pictures directly from the frontend editing interface. I tried all kinds of inline editing options, nothing seemed to work.