gremmie@1: """This file contains the automatic admin site definitions for the weblinks models""" gremmie@1: gremmie@1: from django.contrib import admin gremmie@1: from weblinks.models import Category gremmie@1: from weblinks.models import Link gremmie@1: from weblinks.models import FlaggedLink gremmie@1: gremmie@1: class LinkAdmin(admin.ModelAdmin): gremmie@1: list_display = ('title', 'url', 'category', 'date_added', 'hits', 'is_public') gremmie@1: list_filter = ('date_added', 'is_public', 'category') gremmie@1: date_hierarchy = 'date_added' gremmie@1: ordering = ('-date_added', ) gremmie@1: search_fields = ('title', 'description', 'url', 'user__username') gremmie@1: raw_id_fields = ('user', ) gremmie@1: save_on_top = True gremmie@1: gremmie@1: class FlaggedLinkAdmin(admin.ModelAdmin): gremmie@1: list_display = ('__unicode__', 'url', 'date_flagged') gremmie@1: date_hierarchy = 'date_flagged' gremmie@1: raw_id_fields = ('user', ) gremmie@1: gremmie@1: admin.site.register(Category) gremmie@1: admin.site.register(Link, LinkAdmin) gremmie@1: admin.site.register(FlaggedLink, FlaggedLinkAdmin)