1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-03 19:22:51 +02:00

Register new organizers

This commit is contained in:
Yohann D'ANELLO
2021-01-14 21:07:09 +01:00
parent 1a7a411e10
commit 3e7ff21746
7 changed files with 179 additions and 41 deletions

View File

@ -18,10 +18,15 @@ class RegistrationTable(tables.Table):
accessor="user__last_name",
)
def order_type(self, queryset, desc):
types = ["volunteerregistration__adminregistration", "volunteerregistration", "participantregistration"]
return queryset.order_by(*(("" if desc else "-") + t for t in types)), True
class Meta:
attrs = {
'class': 'table table-condensed table-striped',
}
model = Registration
fields = ('last_name', 'user__first_name', 'user__email', 'type',)
order_by = ('volunteerregistration__adminregistration', 'volunteerregistration', 'last_name', 'first_name',)
template_name = 'django_tables2/bootstrap4.html'