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
Labels
Merge Requests
141
Merge Requests
141
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
0267e440
Commit
0267e440
authored
Nov 06, 2019
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZSQLCatalog.SQLCatalog: Add support for scriptable keys in getColumnSearchKey.
parent
3f079e49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
product/ZSQLCatalog/SQLCatalog.py
product/ZSQLCatalog/SQLCatalog.py
+13
-13
No files found.
product/ZSQLCatalog/SQLCatalog.py
View file @
0267e440
...
...
@@ -1819,15 +1819,20 @@ class Catalog(Folder,
If both a related key and a real column are found, the related key
is used.
"""
# Is key a related key or a "real" column ?
related_key_definition
=
self
.
getRelatedKeyDefinition
(
key
)
if
related_key_definition
is
None
:
if
key
in
self
.
getColumnMap
():
search_key
=
self
.
getSearchKey
(
key
,
search_key_name
)
# Is key a scriptable key, a related key or a "real" column ?
script
=
self
.
getScriptableKeyScript
(
key
)
if
script
is
None
:
related_key_definition
=
self
.
getRelatedKeyDefinition
(
key
)
if
related_key_definition
is
None
:
if
key
in
self
.
getColumnMap
():
search_key
=
self
.
getSearchKey
(
key
,
search_key_name
)
else
:
search_key
=
None
else
:
search_key
=
None
search_key
=
self
.
getSearchKey
(
key
,
'RelatedKey'
)
else
:
search_key
=
self
.
getSearchKey
(
key
,
'RelatedKey'
)
search_key
=
SearchKeyWrapperForScriptableKey
(
key
,
script
)
related_key_definition
=
None
return
search_key
,
related_key_definition
security
.
declarePrivate
(
'hasColumn'
)
...
...
@@ -1960,12 +1965,7 @@ class Catalog(Folder,
"""
Determine the SearchKey to use to generate a Query, and call buildQueryFromSearchKey with it.
"""
script
=
self
.
getScriptableKeyScript
(
key
)
if
script
is
None
:
search_key
,
related_key_definition
=
self
.
getColumnSearchKey
(
key
,
search_key_name
)
else
:
search_key
=
SearchKeyWrapperForScriptableKey
(
key
,
script
)
related_key_definition
=
None
search_key
,
related_key_definition
=
self
.
getColumnSearchKey
(
key
,
search_key_name
)
if
search_key
is
None
:
message
=
'Unknown column '
+
repr
(
key
)
if
not
ignore_unknown_columns
:
...
...
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