Mercurial > public > sg101
comparison news/forms.py @ 1017:21c592cac71c
ManifestStaticFilesStorage: stop using form Media.
It's okay for the admin, but not for user facing stuff.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 06 Dec 2015 14:48:30 -0600 |
parents | fa52bfb28217 |
children |
comparison
equal
deleted
inserted
replaced
1016:fd70e9d547ed | 1017:21c592cac71c |
---|---|
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 |
8 from core.html import ImageCheckError | 7 from core.html import ImageCheckError |
9 from core.html import image_check | 8 from core.html import image_check |
10 from core.markup import site_markup | 9 from core.markup import site_markup |
11 from news.models import PendingStory | 10 from news.models import PendingStory |
25 })) | 24 })) |
26 | 25 |
27 class Meta: | 26 class Meta: |
28 model = PendingStory | 27 model = PendingStory |
29 fields = ['title', 'category', 'short_markup'] | 28 fields = ['title', 'category', 'short_markup'] |
30 | |
31 class Media: | |
32 css = { | |
33 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + | |
34 settings.GPP_THIRD_PARTY_CSS['jquery-ui']) | |
35 } | |
36 js = ( | |
37 settings.GPP_THIRD_PARTY_JS['markitup'] + | |
38 settings.GPP_THIRD_PARTY_JS['jquery-ui'] + | |
39 ['js/jquery.form.min.js'] | |
40 ) | |
41 | 29 |
42 def clean_short_markup(self): | 30 def clean_short_markup(self): |
43 md = self.cleaned_data['short_markup'] | 31 md = self.cleaned_data['short_markup'] |
44 self.html = None | 32 self.html = None |
45 if not md: | 33 if not md: |