summaryrefslogtreecommitdiff
path: root/app/links/admin.py
blob: 4c3f6136169cf2a684c34af2978d5a5a43c5b0e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from django.contrib import admin

from utils.widgets import TagListFilter
from links.models import Link


class LinkAdmin(admin.ModelAdmin):
    list_display = ('title', 'admin_link', 'pub_date', 'status')
    search_fields = ['title', 'description', 'url']
    list_filter = ['rating', 'status', TagListFilter]
    fieldsets = (
        (None, {
            'fields': (
                'title',
                'url',
                'description',
            )
        }),
        ('Details', {
            'fields': (
                'pub_date',
                'tags',
                'status'
            ),
            'classes': 'collapse'
        }),
    )

admin.site.register(Link, LinkAdmin)