Merge pull request #6 from lsxliron/fix_admin

Enhanced the admin page
This commit is contained in:
Sascha Ißbrücker 2019-12-29 14:58:22 +01:00 committed by GitHub
commit 1bd80dd1cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 3 deletions

View File

@ -1,6 +1,17 @@
from django.contrib import admin from django.contrib import admin
# Register your models here. from bookmarks.models import Bookmark, Tag
from bookmarks.models import Bookmark
admin.site.register(Bookmark) @admin.register(Bookmark)
class AdminBookmark(admin.ModelAdmin):
list_display = ('title', 'url', 'date_added')
search_fields = ('title', 'url', 'tags__name')
list_filter = ('tags',)
ordering = ('-date_added', )
@admin.register(Tag)
class AdminTag(admin.ModelAdmin):
list_display = ('name', 'date_added', 'owner')
search_fields = ('name', 'owner__username')
list_filter = ('owner__username', )
ordering = ('-date_added', )