Mercurial > public > sg101
comparison gpp/weblinks/forms.py @ 242:7e8d2dda99e3
For #93: fix url scheme for weblinks.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 15 Sep 2010 03:24:01 +0000 |
parents | b4305e18d3af |
children | d424b8bae71d |
comparison
equal
deleted
inserted
replaced
241:27bee3ac85e6 | 242:7e8d2dda99e3 |
---|---|
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 PendingLink, Link | 6 from weblinks.models import PendingLink, Link |
7 | |
8 class SearchForm(forms.Form): | |
9 '''Weblinks search form''' | |
10 text = forms.CharField(max_length = 30) | |
11 | |
12 def query(self): | |
13 return self.cleaned_data['text'] | |
14 | 7 |
15 | 8 |
16 class AddLinkForm(forms.ModelForm): | 9 class AddLinkForm(forms.ModelForm): |
17 title = forms.CharField(widget = forms.TextInput(attrs = {'size': 52})) | 10 title = forms.CharField(widget = forms.TextInput(attrs = {'size': 52})) |
18 url = forms.CharField(widget = forms.TextInput(attrs = {'size': 52})) | 11 url = forms.CharField(widget = forms.TextInput(attrs = {'size': 52})) |