diff piecrust/sources/base.py @ 977:84fc72a17f7a

sources: Changes in related contents management. - Remove `getParentGroup` method, use related contents instead. - Return only a single group when asked for the parent.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 17 Oct 2017 01:11:54 -0700
parents 0eca08213354
children 45ad976712ec
line wrap: on
line diff
--- a/piecrust/sources/base.py	Tue Oct 17 01:09:55 2017 -0700
+++ b/piecrust/sources/base.py	Tue Oct 17 01:11:54 2017 -0700
@@ -13,8 +13,9 @@
 
 
 # Types of relationships a content source can be asked for.
-REL_LOGICAL_PARENT_ITEM = 1
-REL_LOGICAl_CHILD_GROUP = 2
+REL_PARENT_GROUP = 1
+REL_LOGICAL_PARENT_ITEM = 2
+REL_LOGICAl_CHILD_GROUP = 3
 REL_ASSETS = 10
 
 
@@ -134,10 +135,6 @@
         raise NotImplementedError(
             "'%s' doesn't implement 'getContents'." % self.__class__)
 
-    def getParentGroup(self, item):
-        raise NotImplementedError(
-            "'%s' doesn't implement 'getParentGroup'." % self.__class__)
-
     def getRelatedContents(self, item, relationship):
         raise NotImplementedError(
             "'%s' doesn't implement 'getRelatedContents'." % self.__class__)