Commit d21f577c authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

unset_attribute_storage, for testing purpose at least

parent 270a75f6e33f
......@@ -231,6 +231,9 @@ class NativeSQLSource(SQLAdapterMixIn, AbstractSource):
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):
......
......@@ -10,6 +10,10 @@ def set_attribute_storage(repo, etype, attr, storage):
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"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment