mirror of
https://github.com/sissbruecker/linkding
synced 2024-11-10 06:04:15 +00: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:
parent
d298260122
commit
5287eb3f8b
1 changed files with 2 additions and 0 deletions
|
@ -58,6 +58,8 @@ class AdminTag(admin.ModelAdmin):
|
|||
|
||||
def bookmarks_count(self, obj):
|
||||
return obj.bookmarks_count
|
||||
|
||||
bookmarks_count.admin_order_field = 'bookmarks_count'
|
||||
|
||||
def delete_unused_tags(self, request, queryset: QuerySet):
|
||||
unused_tags = queryset.filter(bookmark__isnull=True)
|
||||
|
|
Loading…
Reference in a new issue