from django.contrib import admin from django.conf.urls import url from django.utils.translation import ungettext, ugettext_lazy as _ from django.shortcuts import render from django.contrib.admin import helpers from django.http import HttpResponseRedirect from utils.widgets import TagListFilter import autocomplete_light from .models import Link from .forms import LinkForm class LinkAdmin(admin.ModelAdmin): form = LinkForm list_display = ('title', 'admin_link', 'pub_date', 'status') search_fields = ['title', 'description', 'url'] list_filter = ['status', TagListFilter] fieldsets = ( (None, { 'fields': ( 'title', 'url', 'description', 'body_markdown', ) }), ('Details', { 'fields': ( 'pub_date', 'tags', 'status' ), 'classes': 'collapse' }), ) admin.site.register(Link, LinkAdmin)