Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
ad995a9905f9
Commit
ad5f77d4
authored
Mar 12, 2019
by
Nicolas Chauvat
Browse files
[server/querier] remove useless indirection QuerierHelper._annotate
parent
23081860ea60
Changes
3
Hide whitespace changes
Inline
Side-by-side
cubicweb/server/querier.py
View file @
ad995a99
...
...
@@ -480,10 +480,8 @@ class QuerierHelper(object):
def
set_schema
(
self
,
schema
):
self
.
schema
=
schema
self
.
clear_caches
()
rqlhelper
=
self
.
_repo
.
vreg
.
rqlhelper
self
.
_annotate
=
rqlhelper
.
annotate
# rql planner
self
.
_planner
=
SSPlanner
(
schema
,
rqlhelper
)
self
.
_planner
=
SSPlanner
(
schema
,
self
.
_repo
.
vreg
.
rqlhelper
)
# sql generation annotator
self
.
sqlgen_annotate
=
SQLGenAnnotator
(
schema
).
annotate
...
...
@@ -549,7 +547,7 @@ class QuerierHelper(object):
# Rewrite computed relations
rewriter
=
RQLRelationRewriter
(
cnx
)
rewriter
.
rewrite
(
rqlst
,
args
)
self
.
_annotate
(
rqlst
)
self
.
_
repo
.
vreg
.
rqlhelper
.
annotate
(
rqlst
)
if
args
:
# different SQL generated when some argument is None or not (IS
# NULL). This should be considered when computing sql cache key
...
...
cubicweb/server/test/unittest_security.py
View file @
ad995a99
...
...
@@ -523,9 +523,8 @@ class SecurityTC(BaseSecurityTC):
with
self
.
new_access
(
u
'iaminusersgrouponly'
).
repo_cnx
()
as
cnx
:
rqlst
=
self
.
repo
.
vreg
.
rqlhelper
.
parse
(
'Any X WHERE X is_instance_of Societe'
)
self
.
repo
.
vreg
.
solutions
(
cnx
,
rqlst
,
{})
querier
=
cnx
.
repo
.
querier
querier
.
_annotate
(
rqlst
)
plan
=
querier
.
plan_factory
(
rqlst
,
{},
cnx
)
self
.
repo
.
vreg
.
rqlhelper
.
annotate
(
rqlst
)
plan
=
cnx
.
repo
.
querier
.
plan_factory
(
rqlst
,
{},
cnx
)
plan
.
preprocess
(
rqlst
)
self
.
assertEqual
(
rqlst
.
as_string
(),
...
...
cubicweb/test/unittest_rqlrewrite.py
View file @
ad995a99
...
...
@@ -602,12 +602,11 @@ class RewriteFullTC(CubicWebTC):
def
process
(
self
,
rql
,
args
=
None
):
if
args
is
None
:
args
=
{}
querier
=
self
.
repo
.
querier
union
=
parse
(
rql
)
# self.vreg.parse(rql, annotate=True)
with
self
.
admin_access
.
repo_cnx
()
as
cnx
:
self
.
vreg
.
solutions
(
cnx
,
union
,
args
)
queri
er
.
_
annotate
(
union
)
plan
=
querier
.
plan_factory
(
union
,
args
,
cnx
)
self
.
vreg
.
rqlhelp
er
.
annotate
(
union
)
plan
=
self
.
repo
.
querier
.
plan_factory
(
union
,
args
,
cnx
)
plan
.
preprocess
(
union
)
return
union
...
...
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