Mercurial > public > sg101
comparison gpp/weblinks/admin.py @ 1:dbd703f7d63a
Initial import of sg101 stuff from private repository.
author | gremmie |
---|---|
date | Mon, 06 Apr 2009 02:43:12 +0000 |
parents | |
children | 952e05cb3d80 |
comparison
equal
deleted
inserted
replaced
0:900ba3c7b765 | 1:dbd703f7d63a |
---|---|
1 """This file contains the automatic admin site definitions for the weblinks models""" | |
2 | |
3 from django.contrib import admin | |
4 from weblinks.models import Category | |
5 from weblinks.models import Link | |
6 from weblinks.models import FlaggedLink | |
7 | |
8 class LinkAdmin(admin.ModelAdmin): | |
9 list_display = ('title', 'url', 'category', 'date_added', 'hits', 'is_public') | |
10 list_filter = ('date_added', 'is_public', 'category') | |
11 date_hierarchy = 'date_added' | |
12 ordering = ('-date_added', ) | |
13 search_fields = ('title', 'description', 'url', 'user__username') | |
14 raw_id_fields = ('user', ) | |
15 save_on_top = True | |
16 | |
17 class FlaggedLinkAdmin(admin.ModelAdmin): | |
18 list_display = ('__unicode__', 'url', 'date_flagged') | |
19 date_hierarchy = 'date_flagged' | |
20 raw_id_fields = ('user', ) | |
21 | |
22 admin.site.register(Category) | |
23 admin.site.register(Link, LinkAdmin) | |
24 admin.site.register(FlaggedLink, FlaggedLinkAdmin) |