sort persons alphabetically
This commit is contained in:
parent
e84cdd5ea6
commit
9ef16f3c63
|
@ -2,6 +2,8 @@
|
|||
|
||||
from Products.Five import BrowserView
|
||||
|
||||
from themis.fields.vocabs import cmp_person
|
||||
|
||||
class View(BrowserView):
|
||||
def presidence_polgroups(self):
|
||||
return [self.context.president.to_object.polgroup.to_object]
|
||||
|
@ -28,19 +30,19 @@ class View(BrowserView):
|
|||
return self.list_polgroups(self.context.vicepresidents)
|
||||
|
||||
def vicepresidence_members(self, polgroup):
|
||||
return [x.to_object for x in self.context.vicepresidents
|
||||
if x.to_object.polgroup.to_object == polgroup]
|
||||
return sorted([x.to_object for x in self.context.vicepresidents
|
||||
if x.to_object.polgroup.to_object == polgroup], cmp_person)
|
||||
|
||||
def members_polgroups(self):
|
||||
return self.list_polgroups(self.context.members)
|
||||
|
||||
def members_members(self, polgroup):
|
||||
return [x.to_object for x in self.context.members
|
||||
if x.to_object.polgroup.to_object == polgroup]
|
||||
return sorted([x.to_object for x in self.context.members
|
||||
if x.to_object.polgroup.to_object == polgroup], cmp_person)
|
||||
|
||||
def substitutes_polgroups(self):
|
||||
return self.list_polgroups(self.context.substitutes)
|
||||
|
||||
def substitutes_members(self, polgroup):
|
||||
return [x.to_object for x in self.context.substitutes
|
||||
if x.to_object.polgroup.to_object == polgroup]
|
||||
return sorted([x.to_object for x in self.context.substitutes
|
||||
if x.to_object.polgroup.to_object == polgroup], cmp_person)
|
||||
|
|
Reference in New Issue