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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
erp5
Commits
2bd5e31f
Commit
2bd5e31f
authored
Apr 29, 2014
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Catalog.CatalogTool: Support all catalog columns in auto-generated related keys.
parent
4711e761
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
product/ERP5Catalog/CatalogTool.py
product/ERP5Catalog/CatalogTool.py
+5
-4
No files found.
product/ERP5Catalog/CatalogTool.py
View file @
2bd5e31f
...
@@ -893,6 +893,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
...
@@ -893,6 +893,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
default_string
=
'default_'
default_string
=
'default_'
strict_string
=
'strict_'
strict_string
=
'strict_'
related_string
=
'related_'
related_string
=
'related_'
column_map
=
self
.
getSQLCatalog
(
sql_catalog_id
).
getColumnMap
()
for
key
in
key_list
:
for
key
in
key_list
:
prefix
=
''
prefix
=
''
strict
=
0
strict
=
0
...
@@ -915,10 +916,10 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
...
@@ -915,10 +916,10 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
related
=
end_key
.
startswith
(
related_string
)
related
=
end_key
.
startswith
(
related_string
)
if
related
:
if
related
:
end_key
=
end_key
[
len
(
related_string
):]
end_key
=
end_key
[
len
(
related_string
):]
#
accept only some catalog column
s
#
XXX: joining with non-catalog tables is not trivial and require
s
if
end_key
in
(
'title'
,
'uid'
,
'description'
,
'reference'
,
# ZSQLCatalog's ColumnMapper cooperation, so only allow catalog
'relative_url'
,
'id'
,
'portal_type'
,
# columns.
'simulation_state'
):
if
'catalog'
in
column_map
.
get
(
end_key
,
()
):
is_uid
=
end_key
==
'uid'
is_uid
=
end_key
==
'uid'
if
is_uid
:
if
is_uid
:
end_key
=
'uid'
if
related
else
'category_uid'
end_key
=
'uid'
if
related
else
'category_uid'
...
...
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