Merge branch 'master' into orm
[tiramisu.git] / tiramisu / setting.py
index e9449b7..f95674e 100644 (file)
@@ -243,6 +243,12 @@ populate_multitypes()
 
 
 # ____________________________________________________________
+class Undefined():
+    pass
+
+
+undefined = Undefined()
+# ____________________________________________________________
 class Property(object):
     "a property is responsible of the option's value access rules"
     __slots__ = ('_setting', '_properties', '_opt', '_path')
@@ -410,10 +416,11 @@ class Settings(object):
         """
         # opt properties
         properties = copy(self._getproperties(opt_or_descr, path))
+        self_properties = copy(self._getproperties())
         # remove opt permissive
-        properties -= self._p_.getpermissive(path)
+        if force_permissive is True or 'permissive' in self_properties:
+            properties -= self._p_.getpermissive(path)
         # remove global permissive if need
-        self_properties = copy(self._getproperties())
         if force_permissive is True or 'permissive' in self_properties:
             properties -= self._p_.getpermissive()
         if force_permissives is not None: