Mercurial > public > sg101
comparison gpp/news/forms.py @ 7:ca66189c7c44
Added tiny_mce to the GPP_THIRD_PARTY_JS setting. Updated code to use it.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 12 Apr 2009 00:31:36 +0000 |
parents | dbd703f7d63a |
children | 6dbb8faef085 |
comparison
equal
deleted
inserted
replaced
6:b6263ac72052 | 7:ca66189c7c44 |
---|---|
1 """ | 1 """ |
2 Forms for the news application. | 2 Forms for the news application. |
3 """ | 3 """ |
4 | 4 |
5 from django import forms | 5 from django import forms |
6 from django.conf import settings | |
7 | |
6 from news.models import PendingStory | 8 from news.models import PendingStory |
7 from news.models import Category | 9 from news.models import Category |
8 | 10 |
9 | 11 |
10 class AddNewsForm(forms.ModelForm): | 12 class AddNewsForm(forms.ModelForm): |
16 class Meta: | 18 class Meta: |
17 model = PendingStory | 19 model = PendingStory |
18 exclude = ('submitter', 'date_submitted', 'allow_comments', 'approved', 'tags') | 20 exclude = ('submitter', 'date_submitted', 'allow_comments', 'approved', 'tags') |
19 | 21 |
20 class Media: | 22 class Media: |
21 js = ('js/tiny_mce/tiny_mce.js', 'js/tiny_mce_init_std.js') | 23 js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] |
22 | 24 |
23 | 25 |
24 class SearchNewsForm(forms.Form): | 26 class SearchNewsForm(forms.Form): |
25 """Form for a user to search news stories.""" | 27 """Form for a user to search news stories.""" |
26 text = forms.CharField(max_length=30) | 28 text = forms.CharField(max_length=30) |
48 return self.cleaned_data['friend_email'] | 50 return self.cleaned_data['friend_email'] |
49 | 51 |
50 def name(self): | 52 def name(self): |
51 return self.cleaned_data['friend_name'] | 53 return self.cleaned_data['friend_name'] |
52 | 54 |
53 |