Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
e7ac20bf3629
Commit
d21f577c
authored
Feb 08, 2010
by
Sylvain Thénault
Browse files
unset_attribute_storage, for testing purpose at least
parent
270a75f6e33f
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/sources/native.py
View file @
e7ac20bf
...
...
@@ -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
):
...
...
server/sources/storages.py
View file @
e7ac20bf
...
...
@@ -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"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment