Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
cf657fc4
Commit
cf657fc4
authored
Aug 06, 2015
by
Boris Kocherov
Committed by
Vincent Pelletier
Apr 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sqlcatalog properties could not be changed through form edit if database connection does not exist.
parent
254a3712
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
19 deletions
+27
-19
product/ZSQLCatalog/SQLCatalog.py
product/ZSQLCatalog/SQLCatalog.py
+27
-19
No files found.
product/ZSQLCatalog/SQLCatalog.py
View file @
cf657fc4
...
@@ -28,6 +28,7 @@ from AccessControl.SimpleObjectPolicies import ContainerAssertions
...
@@ -28,6 +28,7 @@ from AccessControl.SimpleObjectPolicies import ContainerAssertions
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBTree
from
App.config
import
getConfiguration
from
App.config
import
getConfiguration
from
BTrees.Length
import
Length
from
BTrees.Length
import
Length
from
Shared.DC.ZRDB.DA
import
DatabaseError
from
Shared.DC.ZRDB.TM
import
TM
from
Shared.DC.ZRDB.TM
import
TM
from
Acquisition
import
aq_parent
,
aq_inner
,
aq_base
from
Acquisition
import
aq_parent
,
aq_inner
,
aq_base
...
@@ -1076,19 +1077,22 @@ class Catalog(Folder,
...
@@ -1076,19 +1077,22 @@ class Catalog(Folder,
return
self
.
sql_search_result_keys
return
self
.
sql_search_result_keys
def
_getCatalogSchema
(
self
,
table
=
None
):
def
_getCatalogSchema
(
self
,
table
=
None
):
result_list
=
[]
method_name
=
self
.
sql_catalog_schema
try
:
try
:
method_name
=
self
.
sql_catalog_schema
method
=
getattr
(
self
,
method_name
)
method
=
getattr
(
self
,
method_name
)
search_result
=
method
(
table
=
table
)
except
AttributeError
:
for
c
in
search_result
:
result_list
.
append
(
c
.
Field
)
except
ConflictError
:
raise
except
:
LOG
(
'SQLCatalog'
,
WARNING
,
'_getCatalogSchema failed with the method %s'
%
method_name
,
error
=
sys
.
exc_info
())
pass
pass
return
tuple
(
result_list
)
else
:
try
:
return
tuple
(
c
.
Field
for
c
in
method
(
table
=
table
))
except
(
ConflictError
,
DatabaseError
):
raise
except
Exception
:
pass
LOG
(
'SQLCatalog'
,
WARNING
,
'_getCatalogSchema failed with the method %s'
%
method_name
,
error
=
sys
.
exc_info
())
return
()
@
transactional_cache_decorator
(
'SQLCatalog.getColumnIds'
)
@
transactional_cache_decorator
(
'SQLCatalog.getColumnIds'
)
def
_getColumnIds
(
self
):
def
_getColumnIds
(
self
):
...
@@ -1160,18 +1164,22 @@ class Catalog(Folder,
...
@@ -1160,18 +1164,22 @@ class Catalog(Folder,
Calls the show table method and returns dictionnary of
Calls the show table method and returns dictionnary of
Field Ids
Field Ids
"""
"""
keys
=
[]
method_name
=
self
.
sql_catalog_tables
method_name
=
self
.
sql_catalog_tables
try
:
try
:
method
=
getattr
(
self
,
method_name
)
method
=
getattr
(
self
,
method_name
)
search_result
=
method
()
except
AttributeError
:
for
c
in
search_result
:
keys
.
append
(
c
[
0
])
except
ConflictError
:
raise
except
:
pass
pass
return
keys
else
:
try
:
return
[
c
[
0
]
for
c
in
method
()]
except
(
ConflictError
,
DatabaseError
):
raise
except
Exception
:
pass
LOG
(
'SQLCatalog'
,
WARNING
,
'getTableIds failed with the method %s'
%
method_name
,
error
=
sys
.
exc_info
())
return
[]
security
.
declarePrivate
(
'getUIDBuffer'
)
security
.
declarePrivate
(
'getUIDBuffer'
)
def
getUIDBuffer
(
self
,
force_new_buffer
=
False
):
def
getUIDBuffer
(
self
,
force_new_buffer
=
False
):
...
...
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