merge default doc-dc
authorDamien Correia
Wed, 16 May 2018 14:05:38 +0200
branchdoc-dc
changeset 255 ecccb445b517
parent 254 1adc0ffda366 (current diff)
parent 176 f2acf176be2c (diff)
child 256 24d96b180e55
merge default
--- a/buildout.cfg	Fri Apr 27 11:59:18 2018 +0200
+++ b/buildout.cfg	Wed May 16 14:05:38 2018 +0200
@@ -96,4 +96,4 @@
 eggs = pyams_utils [test]
 
 [versions]
-pyams_utils = 0.1.14
+pyams_utils = 0.1.15
--- a/setup.py	Fri Apr 27 11:59:18 2018 +0200
+++ b/setup.py	Wed May 16 14:05:38 2018 +0200
@@ -25,7 +25,7 @@
 README = os.path.join(DOCS, 'README.txt')
 HISTORY = os.path.join(DOCS, 'HISTORY.txt')
 
-version = '0.1.14'
+version = '0.1.15'
 long_description = open(README).read() + '\n\n' + open(HISTORY).read()
 
 tests_require = [
--- a/src/pyams_utils/inherit.py	Fri Apr 27 11:59:18 2018 +0200
+++ b/src/pyams_utils/inherit.py	Wed May 16 14:05:38 2018 +0200
@@ -61,6 +61,15 @@
     def no_inherit(self, value):
         self.inherit = not bool(value)
 
+    @property
+    def inherit_from(self):
+        if not self.inherit:
+            return self
+        parent = self.parent
+        while self.adapted_interface(parent).inherit:
+            parent = parent.parent
+        return parent
+
 
 class InheritedFieldProperty(object):
     """Inherited field property"""
--- a/src/pyams_utils/interfaces/inherit.py	Fri Apr 27 11:59:18 2018 +0200
+++ b/src/pyams_utils/interfaces/inherit.py	Wed May 16 14:05:38 2018 +0200
@@ -41,3 +41,5 @@
     no_inherit = Bool(title=_("Don't inherit from parent?"),
                       required=False,
                       default=False)
+
+    inherit_from = Attribute("Parent from which adapted interface is inherited")