mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-07 10:58:25 +02:00
Make bookmarks count column in admin sortable (#183)
The Tag view in django admin has a calculated bookmark count column that is unsortable. This fixes it
This commit is contained in:
@@ -58,6 +58,8 @@ class AdminTag(admin.ModelAdmin):
|
|||||||
|
|
||||||
def bookmarks_count(self, obj):
|
def bookmarks_count(self, obj):
|
||||||
return obj.bookmarks_count
|
return obj.bookmarks_count
|
||||||
|
|
||||||
|
bookmarks_count.admin_order_field = 'bookmarks_count'
|
||||||
|
|
||||||
def delete_unused_tags(self, request, queryset: QuerySet):
|
def delete_unused_tags(self, request, queryset: QuerySet):
|
||||||
unused_tags = queryset.filter(bookmark__isnull=True)
|
unused_tags = queryset.filter(bookmark__isnull=True)
|
||||||
|
Reference in New Issue
Block a user