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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
35a22887
Commit
35a22887
authored
Jan 20, 2021
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMFActivity.Activity.SQLBase: Const-ify row2key.
parent
94db4215
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
product/CMFActivity/Activity/SQLBase.py
product/CMFActivity/Activity/SQLBase.py
+6
-4
No files found.
product/CMFActivity/Activity/SQLBase.py
View file @
35a22887
...
...
@@ -28,6 +28,7 @@
from
collections
import
defaultdict
from
itertools
import
product
import
operator
import
sys
import
transaction
from
random
import
getrandbits
...
...
@@ -72,6 +73,9 @@ def sort_message_key(message):
_DequeueMessageException
=
Exception
()
_ITEMGETTER0
=
operator
.
itemgetter
(
0
)
_IDENTITY
=
lambda
x
:
x
def
render_datetime
(
x
):
return
"%.4d-%.2d-%.2d %.2d:%.2d:%09.6f"
%
x
.
toZone
(
'UTC'
).
parts
()[:
6
]
...
...
@@ -525,12 +529,10 @@ CREATE TABLE %s (
continue
column_list
,
to_sql
=
dependency_tester_dict
[
dependency_name
]
if
len
(
column_list
)
==
1
:
def
row2key
(
row
):
key
,
=
row
return
key
row2key
=
_ITEMGETTER0
dependency_sql
=
to_sql
(
dependency_value_dict
.
keys
(),
quote
)
else
:
row2key
=
lambda
x
:
x
row2key
=
_IDENTITY
# XXX: generated SQL could be simpler: for example, a dependency input
# as
# ('foo', ('bar', 'baz'))
...
...
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