manager: fix ordering in user's roles table (#16474) #196
No reviewers
Labels
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: entrouvert/authentic#196
Loading…
Reference in New Issue
No description provided.
Delete Branch "wip/16474-manage-tri-asciibetique-des-rol"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A list was used instead of a queryset to allow django-tables2 to order
the table by the boolean value of the prefetched member attribute,
django-tables2 could not do it if the list was a queryset.
The side effect is that the sorting was done by Python instead of
PostgreSQL by Python does not respect unicode collation when doing so.
Member is now replaced by a subquery using the pair Exists/OuterRef and
sorting is now only done by PostgreSQL.
Voilà c'est trié correctement.
334e313281
to8536c17f84
@ -229,3 +229,3 @@
),
verbose_name=_('Member'),
order_by=('member', 'via', 'name'),
order_by=('member', '-name'),
Pourquoi est-ce qu’on passe à un ordre inverse sur
name
ici ?Erreur c'était sur member le - (pour que True arrive avabt False).
8536c17f84
tof45440e035
Ok.
Aussi le functools.lru_cache c'est parce que les classes dynamiques ne sont pas garbage collectées immédiatement (https://stackoverflow.com/questions/28523606/when-are-python-classes-and-class-attributes-garbage-collected) car il y a des cycles.