Fixed sorting on user roles table
This commit is contained in:
parent
a6b6080e7d
commit
ea8230335f
|
@ -634,7 +634,7 @@ class Service(models.Model):
|
||||||
|
|
||||||
def get_roles(self):
|
def get_roles(self):
|
||||||
if self.rol.exists():
|
if self.rol.exists():
|
||||||
return ", ".join([x.name for x in self.rol.all()])
|
return ", ".join([x.name for x in self.rol.order_by("name")])
|
||||||
return _("None")
|
return _("None")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
|
@ -69,7 +69,14 @@ class RolesTable(tables.Table):
|
||||||
|
|
||||||
def order_description(self, queryset, is_descending):
|
def order_description(self, queryset, is_descending):
|
||||||
queryset = queryset.order_by(
|
queryset = queryset.order_by(
|
||||||
("-" if is_descending else "") + "service__rol__description"
|
("-" if is_descending else "") + "service__description"
|
||||||
|
)
|
||||||
|
|
||||||
|
return (queryset, True)
|
||||||
|
|
||||||
|
def order_service(self, queryset, is_descending):
|
||||||
|
queryset = queryset.order_by(
|
||||||
|
("-" if is_descending else "") + "service__domain"
|
||||||
)
|
)
|
||||||
|
|
||||||
return (queryset, True)
|
return (queryset, True)
|
||||||
|
|
Loading…
Reference in New Issue