Mercurial > public > sg101
comparison gpp/downloads/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 | b6263ac72052 |
comparison
equal
deleted
inserted
replaced
0:900ba3c7b765 | 1:dbd703f7d63a |
---|---|
1 """ | |
2 This file contains the automatic admin site definitions for the downloads models. | |
3 """ | |
4 from django.contrib import admin | |
5 from downloads.models import Download | |
6 from downloads.models import Category | |
7 from downloads.models import AllowedExtension | |
8 from downloads.models import VoteRecord | |
9 | |
10 class DownloadAdmin(admin.ModelAdmin): | |
11 exclude = ('html', ) | |
12 list_display = ('title', 'user', 'category', 'date_added', 'ip_address', | |
13 'hits', 'average_score', 'size', 'is_public') | |
14 list_filter = ('date_added', 'is_public', 'category', 'user', 'ip_address') | |
15 date_hierarchy = 'date_added' | |
16 ordering = ('-date_added', ) | |
17 search_fields = ('title', 'description', 'user__username') | |
18 raw_id_fields = ('user', ) | |
19 save_on_top = True | |
20 | |
21 class Media: | |
22 css = { | |
23 'all': ('js/markitup/skins/markitup/style.css', | |
24 'js/markitup/sets/markdown/style.css') | |
25 } | |
26 js = ( | |
27 'js/jquery-1.2.6.min.js', | |
28 'js/markitup/jquery.markitup.pack.js', | |
29 'js/markitup/sets/markdown/set.js', | |
30 'js/downloads_admin.js', | |
31 ) | |
32 | |
33 | |
34 class VoteRecordAdmin(admin.ModelAdmin): | |
35 list_display = ('user', 'download', 'vote_date') | |
36 list_filter = ('user', 'download') | |
37 date_hierarchy = 'vote_date' | |
38 | |
39 | |
40 admin.site.register(Download, DownloadAdmin) | |
41 admin.site.register(Category) | |
42 admin.site.register(AllowedExtension) | |
43 admin.site.register(VoteRecord, VoteRecordAdmin) |