--- a/server/sources/native.py Mon Feb 08 21:29:59 2010 +0100
+++ b/server/sources/native.py Mon Feb 08 22:41:07 2010 +0100
@@ -231,6 +231,9 @@
def map_attribute(self, etype, attr, cb):
self._rql_sqlgen.attr_map['%s.%s' % (etype, attr)] = cb
+ def unmap_attribute(self, etype, attr):
+ self._rql_sqlgen.attr_map.pop('%s.%s' % (etype, attr), None)
+
# ISource interface #######################################################
def compile_rql(self, rql, sols):
--- a/server/sources/storages.py Mon Feb 08 21:29:59 2010 +0100
+++ b/server/sources/storages.py Mon Feb 08 22:41:07 2010 +0100
@@ -10,6 +10,10 @@
ETYPE_ATTR_STORAGE.setdefault(etype, {})[attr] = storage
repo.system_source.map_attribute(etype, attr, storage.sqlgen_callback)
+def unset_attribute_storage(repo, etype, attr):
+ ETYPE_ATTR_STORAGE.setdefault(etype, {}).pop(attr, None)
+ repo.system_source.unmap_attribute(etype, attr)
+
class Storage(object):
"""abstract storage"""