summaryrefslogtreecommitdiff
path: root/app/links/admin.py
blob: 851005e2729b9e05ed75117737af2f196b4cd124 (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
30
31
32
33
34
from django.contrib import admin
from django.utils.translation import ngettext, gettext_lazy as _
from django.shortcuts import render
from django.contrib.admin import helpers
from django.http import HttpResponseRedirect

from utils.widgets import TagListFilter
from .models import Link


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

    class Media:
        js = ('next-prev-links.js',)