Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RQL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
RQL
Commits
6b28ea39cf54
Commit
6b28ea39cf54
authored
13 years ago
by
Florent Cayré
Browse files
Options
Downloads
Patches
Plain Diff
fix change_optional bug when no root set yet + small add_eid_restriction improvement
parent
7d368dd97930
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nodes.py
+4
-3
4 additions, 3 deletions
nodes.py
with
4 additions
and
3 deletions
nodes.py
+
4
−
3
View file @
6b28ea39
...
...
@@ -184,5 +184,5 @@
return
self
.
add_restriction
(
make_relation
(
lhsvar
,
rtype
,
(
rhsvar
,),
VariableRef
))
def
add_eid_restriction
(
self
,
var
,
eid
):
def
add_eid_restriction
(
self
,
var
,
eid
,
c_type
=
'
Int
'
):
"""
builds a restriction node to express
'
<var> eid <eid>
'"""
...
...
@@ -188,5 +188,6 @@
"""
builds a restriction node to express
'
<var> eid <eid>
'"""
return
self
.
add_constant_restriction
(
var
,
'
eid
'
,
eid
,
'
Int
'
)
assert
c_type
in
(
'
Int
'
,
'
Substitute
'
),
"
Error got c_type=%r in eid restriction
"
%
c_type
return
self
.
add_constant_restriction
(
var
,
'
eid
'
,
eid
,
c_type
)
def
add_type_restriction
(
self
,
var
,
etype
):
"""
builds a restriction node to express : variable is etype
"""
...
...
@@ -478,7 +479,7 @@
def
change_optional
(
self
,
value
):
root
=
self
.
root
if
root
.
should_register_op
and
value
!=
self
.
optional
:
if
root
is
not
None
and
root
.
should_register_op
and
value
!=
self
.
optional
:
from
rql.undo
import
SetOptionalOperation
root
.
undo_manager
.
add_operation
(
SetOptionalOperation
(
self
,
self
.
optional
))
self
.
optional
=
value
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment