Mercurial > public > sg101
comparison gpp/downloads/forms.py @ 204:b4305e18d3af
Resolve ticket #74. Add user badges. Some extra credit was done here: also refactored how pending news, links, and downloads are handled.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 01 May 2010 21:53:59 +0000 |
parents | c515b7401078 |
children | 27bee3ac85e6 |
comparison
equal
deleted
inserted
replaced
203:40e5903903e1 | 204:b4305e18d3af |
---|---|
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 from django.conf import settings |
8 | 8 |
9 from downloads.models import Download | 9 from downloads.models import PendingDownload |
10 from downloads.models import AllowedExtension | 10 from downloads.models import AllowedExtension |
11 | 11 |
12 | 12 |
13 class SearchForm(forms.Form): | 13 class SearchForm(forms.Form): |
14 """Downloads search form.""" | 14 """Downloads search form.""" |
32 if ext in allowed_exts: | 32 if ext in allowed_exts: |
33 return file | 33 return file |
34 raise forms.ValidationError('The file extension "%s" is not allowed.' % ext) | 34 raise forms.ValidationError('The file extension "%s" is not allowed.' % ext) |
35 | 35 |
36 class Meta: | 36 class Meta: |
37 model = Download | 37 model = PendingDownload |
38 fields = ('title', 'category', 'description', 'file') | 38 fields = ('title', 'category', 'description', 'file') |
39 | 39 |
40 class Media: | 40 class Media: |
41 css = { | 41 css = { |
42 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + | 42 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + |