diff gpp/forums/forms.py @ 106:cb72577785df

Forums: implemented the edit post function.
author Brian Neal <bgneal@gmail.com>
date Sat, 19 Sep 2009 21:49:56 +0000
parents e67c4dd98db5
children 80ab249d1adc
line wrap: on
line diff
--- a/gpp/forums/forms.py	Thu Sep 17 02:20:27 2009 +0000
+++ b/gpp/forums/forms.py	Sat Sep 19 21:49:56 2009 +0000
@@ -17,7 +17,7 @@
     profile.save()
 
 
-class PostForm(forms.Form):
+class NewPostForm(forms.Form):
     """Form for creating a new post."""
     body = forms.CharField(label='', widget=forms.Textarea)
     topic_id = forms.IntegerField(widget=forms.HiddenInput)
@@ -99,3 +99,21 @@
 
         bump_post_count(self.user)
         return topic
+
+
+class PostForm(forms.ModelForm):
+    """
+    Form for editing an existing post.
+    """
+    body = forms.CharField(label='', widget=forms.Textarea)
+
+    class Meta:
+        model = Post
+        fields = ('body', )
+
+    class Media:
+        css = {
+            'all': settings.GPP_THIRD_PARTY_CSS['markitup'],
+        }
+        js = settings.GPP_THIRD_PARTY_JS['markitup'] + \
+            ('js/forums.js', )