comparison gpp/downloads/admin.py @ 6:b6263ac72052

Use DRY principle to manage third party javascript libraries. Created script_tags template tags to generate the correct link and script tags for 3rd party libraries. The settings.py file is the only place where the full path name is specified.
author Brian Neal <bgneal@gmail.com>
date Sat, 11 Apr 2009 22:50:56 +0000
parents dbd703f7d63a
children d6f3c38e8f50
comparison
equal deleted inserted replaced
5:63696b279e35 6:b6263ac72052
1 """ 1 """
2 This file contains the automatic admin site definitions for the downloads models. 2 This file contains the automatic admin site definitions for the downloads models.
3 """ 3 """
4 from django.contrib import admin 4 from django.contrib import admin
5 from django.conf import settings
6
5 from downloads.models import Download 7 from downloads.models import Download
6 from downloads.models import Category 8 from downloads.models import Category
7 from downloads.models import AllowedExtension 9 from downloads.models import AllowedExtension
8 from downloads.models import VoteRecord 10 from downloads.models import VoteRecord
9 11
18 raw_id_fields = ('user', ) 20 raw_id_fields = ('user', )
19 save_on_top = True 21 save_on_top = True
20 22
21 class Media: 23 class Media:
22 css = { 24 css = {
23 'all': ('js/markitup/skins/markitup/style.css', 25 'all': settings.GPP_THIRD_PARTY_CSS['markitup'],
24 'js/markitup/sets/markdown/style.css')
25 } 26 }
26 js = ( 27 js = settings.GPP_THIRD_PARTY_JS['jquery'] + \
27 'js/jquery-1.2.6.min.js', 28 settings.GPP_THIRD_PARTY_JS['markitup'] + \
28 'js/markitup/jquery.markitup.pack.js', 29 ('js/downloads_admin.js', )
29 'js/markitup/sets/markdown/set.js',
30 'js/downloads_admin.js',
31 )
32 30
33 31
34 class VoteRecordAdmin(admin.ModelAdmin): 32 class VoteRecordAdmin(admin.ModelAdmin):
35 list_display = ('user', 'download', 'vote_date') 33 list_display = ('user', 'download', 'vote_date')
36 list_filter = ('user', 'download') 34 list_filter = ('user', 'download')