Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Laurent S
erp5
Commits
f7efa99f
Commit
f7efa99f
authored
Sep 19, 2017
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZSQLCatalog: Use symbolic constant instead of duplicating its value
Also, fix a logging context name.
parent
d5d293d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
product/ZSQLCatalog/Query/EntireQuery.py
product/ZSQLCatalog/Query/EntireQuery.py
+5
-5
No files found.
product/ZSQLCatalog/Query/EntireQuery.py
View file @
f7efa99f
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
import
warnings
import
warnings
from
Products.ZSQLCatalog.SQLExpression
import
SQLExpression
from
Products.ZSQLCatalog.SQLExpression
import
SQLExpression
from
Products.ZSQLCatalog.ColumnMap
import
ColumnMap
from
Products.ZSQLCatalog.ColumnMap
import
ColumnMap
from
zLOG
import
LOG
from
zLOG
import
LOG
,
WARNING
from
Products.ZSQLCatalog.interfaces.entire_query
import
IEntireQuery
from
Products.ZSQLCatalog.interfaces.entire_query
import
IEntireQuery
from
zope.interface.verify
import
verifyClass
from
zope.interface.verify
import
verifyClass
from
zope.interface
import
implements
from
zope.interface
import
implements
...
@@ -130,7 +130,7 @@ class EntireQuery(object):
...
@@ -130,7 +130,7 @@ class EntireQuery(object):
try
:
try
:
append
(
column_map
.
asSQLColumn
(
column
))
append
(
column_map
.
asSQLColumn
(
column
))
except
KeyError
:
except
KeyError
:
LOG
(
'EntireQuery'
,
100
,
'Group-by column %r could not be mapped, but is passed through. This use is strongly discouraged.'
%
(
column
,
))
LOG
(
'EntireQuery'
,
WARNING
,
'Group-by column %r could not be mapped, but is passed through. This use is strongly discouraged.'
%
(
column
,
))
append
(
column
)
append
(
column
)
self
.
group_by_list
=
new_column_list
self
.
group_by_list
=
new_column_list
# Build a dictionnary from select_dict aliasing their mapped representations
# Build a dictionnary from select_dict aliasing their mapped representations
...
@@ -147,7 +147,7 @@ class EntireQuery(object):
...
@@ -147,7 +147,7 @@ class EntireQuery(object):
try
:
try
:
rendered
=
column_map
.
asSQLColumn
(
column
)
rendered
=
column_map
.
asSQLColumn
(
column
)
except
KeyError
:
except
KeyError
:
LOG
(
'EntireQuery'
,
100
,
'Select column %r could not be mapped, but is passed through. This use is strongly discouraged.'
%
(
column
,
))
LOG
(
'EntireQuery'
,
WARNING
,
'Select column %r could not be mapped, but is passed through. This use is strongly discouraged.'
%
(
column
,
))
rendered
=
column
rendered
=
column
select_dict
[
alias
]
=
rendered
select_dict
[
alias
]
=
rendered
# Replace given order_by_list entries by their mapped representations.
# Replace given order_by_list entries by their mapped representations.
...
@@ -156,13 +156,13 @@ class EntireQuery(object):
...
@@ -156,13 +156,13 @@ class EntireQuery(object):
for
order_by
in
self
.
order_by_list
:
for
order_by
in
self
.
order_by_list
:
column
=
order_by
[
0
]
column
=
order_by
[
0
]
if
column
in
self
.
order_by_override_set
:
if
column
in
self
.
order_by_override_set
:
LOG
(
'EntireQuery'
,
100
,
'Order-by column %r is forcibly accepted. This use is strongly discouraged.'
%
(
column
,
))
LOG
(
'EntireQuery'
,
WARNING
,
'Order-by column %r is forcibly accepted. This use is strongly discouraged.'
%
(
column
,
))
rendered
=
column
rendered
=
column
else
:
else
:
try
:
try
:
rendered
=
column_map
.
asSQLColumn
(
column
)
rendered
=
column_map
.
asSQLColumn
(
column
)
except
KeyError
:
except
KeyError
:
LOG
(
'
SQLCatalog'
,
100
,
'Order by %r ignored: it could not be mapped to a known column.'
%
(
order_by
,
))
LOG
(
'
EntireQuery'
,
WARNING
,
'Order by %r ignored: it could not be mapped to a known column.'
%
(
order_by
,
))
rendered
=
None
rendered
=
None
if
rendered
is
not
None
:
if
rendered
is
not
None
:
append
((
rendered
,
)
+
tuple
(
order_by
[
1
:])
+
(
append
((
rendered
,
)
+
tuple
(
order_by
[
1
:])
+
(
...
...
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