sort categories/roles/workflows alphabetically in forms
This commit is contained in:
parent
d5ef93eba2
commit
9bf236f289
|
@ -39,10 +39,12 @@ def indent(elem, level=0):
|
|||
|
||||
|
||||
def get_categories():
|
||||
return [(x.id, x.name) for x in Category.select()]
|
||||
t = sorted([(misc.simplify(x.name), x.id, x.name) for x in Category.select()])
|
||||
return [x[1:] for x in t]
|
||||
|
||||
def get_workflows():
|
||||
return [(x.id, x.name) for x in Workflow.select()]
|
||||
t = sorted([(misc.simplify(x.name), x.id, x.name) for x in Workflow.select()])
|
||||
return [x[1:] for x in t]
|
||||
|
||||
|
||||
class FormDefUI:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from qommon.storage import StorableObject
|
||||
import qommon.misc
|
||||
|
||||
class Role(StorableObject):
|
||||
_names = 'roles'
|
||||
|
@ -18,5 +19,6 @@ def logged_users_role():
|
|||
|
||||
|
||||
def get_user_roles():
|
||||
return [(x.id, x.name) for x in Role.select()]
|
||||
t = sorted([(qommon.misc.simplify(x.name), x.id, x.name) for x in Role.select()])
|
||||
return [x[1:] for x in t]
|
||||
|
||||
|
|
Loading…
Reference in New Issue