1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 09:18:23 +02:00

Order participations by validity status and by trigram

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2023-04-11 22:41:52 +02:00
parent 59268f2d1e
commit 0e7a275a28
5 changed files with 35 additions and 6 deletions

View File

@ -19,8 +19,7 @@ class RegistrationTable(tables.Table):
)
def order_type(self, queryset, desc):
types = ["volunteerregistration", "-volunteerregistration__admin", "participantregistration"]
return queryset.order_by(*(("-" if desc else "") + t for t in types)), True
return queryset.order_by(('-' if desc else '') + 'polymorphic_ctype'), True
class Meta:
attrs = {