comparison gpp/weblinks/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 dbd703f7d63a
children 7e8d2dda99e3
comparison
equal deleted inserted replaced
203:40e5903903e1 204:b4305e18d3af
1 """ 1 """
2 Forms for the weblinks application. 2 Forms for the weblinks application.
3 """ 3 """
4 4
5 from django import forms 5 from django import forms
6 from weblinks.models import Link 6 from weblinks.models import PendingLink, Link
7 7
8 class SearchForm(forms.Form): 8 class SearchForm(forms.Form):
9 '''Weblinks search form''' 9 '''Weblinks search form'''
10 text = forms.CharField(max_length = 30) 10 text = forms.CharField(max_length = 30)
11 11
24 except Link.DoesNotExist: 24 except Link.DoesNotExist:
25 return new_url 25 return new_url
26 raise forms.ValidationError('That link already exists in our database.') 26 raise forms.ValidationError('That link already exists in our database.')
27 27
28 class Meta: 28 class Meta:
29 model = Link 29 model = PendingLink
30 exclude = ('user', 'date_added', 'hits', 'is_public') 30 exclude = ('user', 'date_added')