Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
email
Commits
a53ea0f9e76b
Commit
5632564e
authored
Aug 28, 2009
by
Sylvain Thénault
Browse files
use sorted(x, key=...) since we shouldn't compare entities
parent
7e3ebfd2b421
Changes
1
Hide whitespace changes
Inline
Side-by-side
entities.py
View file @
a53ea0f9
...
...
@@ -61,7 +61,7 @@ class Email(TreeMixIn, AnyEntity):
alternatives
.
append
(
set
(
p
.
eid
for
p
in
part
.
alternative
))
alternatives
[
-
1
].
add
(
part
.
eid
)
else
:
result
.
append
(
(
part
.
ordernum
,
part
)
)
result
.
append
(
part
)
if
alternatives
:
for
altset
in
alternatives
:
selected
=
[
parts_by_eid
[
peid
]
for
peid
in
altset
...
...
@@ -70,9 +70,8 @@ class Email(TreeMixIn, AnyEntity):
selected
=
selected
[
0
]
else
:
selected
=
parts_by_eid
[
altset
.
pop
()]
result
.
append
((
selected
.
ordernum
,
selected
))
result
.
sort
()
return
[
p
[
1
]
for
p
in
result
]
result
.
append
(
selected
)
return
sorted
(
result
,
key
=
lambda
x
:
x
.
ordernum
)
def
references
(
self
):
result
=
set
()
...
...
Write
Preview
Supports
Markdown
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