Permalink
Browse files

Added more copy_relations methods.

  • Loading branch information...
1 parent 2e112f1 commit 6e211a05ccbe101d7c91d66581c7deac8d25bb56 @erlenddalen committed May 28, 2013
@@ -17,3 +17,7 @@ class MediaTreeGallery(MediaTreeImageListingBase):
class MediaTreeGalleryItem(MediaTreeImageItemBase):
list_plugin = models.ForeignKey(MediaTreeGallery, related_name='media_items')
node = FileNodeForeignKey(verbose_name=_('folder/file'), limit_choices_to={"site": Site.objects.get_current})
+
+ def copy_relations(self, oldinstance):
+ self.list_plugin = oldinstance.list_plugin.all()
+ self.node = oldinstance.node.all()
@@ -53,3 +53,7 @@ class MediaTreeListing(MediaTreeListingBase):
class MediaTreeListingItem(MediaTreeListingItemBase):
list_plugin = models.ForeignKey(MediaTreeListing, related_name='media_items')
node = FileNodeForeignKey(verbose_name=_('folder/file'), limit_choices_to={"site": Site.objects.get_current})
+
+ def copy_relations(self, oldinstance):
+ self.list_plugin = oldinstance.list_plugin.all()
+ self.node = oldinstance.node.all()
@@ -44,3 +44,7 @@ class Meta:
class MediaTreeSlideshowItem(MediaTreeImageItemBase):
list_plugin = models.ForeignKey(MediaTreeSlideshow, related_name='media_items')
node = FileNodeForeignKey(verbose_name=_('folder/file'), limit_choices_to={"site": Site.objects.get_current})
+
+ def copy_relations(self, oldinstance):
+ self.list_plugin = oldinstance.list_plugin.all()
+ self.node = oldinstance.node.all()

0 comments on commit 6e211a0

Please sign in to comment.