Mercurial > public > sg101
comparison gpp/downloads/forms.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 | f408971657b9 |
comparison
equal
deleted
inserted
replaced
5:63696b279e35 | 6:b6263ac72052 |
---|---|
2 Forms for the downloads application. | 2 Forms for the downloads application. |
3 """ | 3 """ |
4 import os | 4 import os |
5 | 5 |
6 from django import forms | 6 from django import forms |
7 from django.conf import settings | |
7 | 8 |
8 from downloads.models import Download | 9 from downloads.models import Download |
9 from downloads.models import AllowedExtension | 10 from downloads.models import AllowedExtension |
10 | 11 |
11 | 12 |
32 model = Download | 33 model = Download |
33 fields = ('title', 'category', 'description', 'file') | 34 fields = ('title', 'category', 'description', 'file') |
34 | 35 |
35 class Media: | 36 class Media: |
36 css = { | 37 css = { |
37 'all': ('js/markitup/skins/markitup/style.css', | 38 'all': settings.GPP_THIRD_PARTY_CSS['markitup'], |
38 'js/markitup/sets/markdown/style.css') | |
39 } | 39 } |
40 js = ( | 40 js = settings.GPP_THIRD_PARTY_JS['jquery'] + \ |
41 'js/jquery-1.2.6.min.js', | 41 settings.GPP_THIRD_PARTY_JS['markitup'] + \ |
42 'js/downloads/add.js', | 42 ('js/downloads/add.js', ) |
43 'js/markitup/jquery.markitup.pack.js', | 43 |
44 'js/markitup/sets/markdown/set.js', | |
45 ) |