diff options
Diffstat (limited to 'lib/sqlalchemy/util.py')
-rw-r--r-- | lib/sqlalchemy/util.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util.py b/lib/sqlalchemy/util.py index 08b281684..d4627974b 100644 --- a/lib/sqlalchemy/util.py +++ b/lib/sqlalchemy/util.py @@ -127,6 +127,24 @@ class SimpleProperty(object): else: return getattr(obj, self.key) +class NotImplProperty(object): + """a property that raises ``NotImplementedError``.""" + + def __init__(self, doc): + self.__doc__ = doc + + def __set__(self, obj, value): + raise NotImplementedError() + + def __delete__(self, obj): + raise NotImplementedError() + + def __get__(self, obj, owner): + if obj is None: + return self + else: + raise NotImplementedError() + class OrderedProperties(object): """An object that maintains the order in which attributes are set upon it. |