comparison gpp/forums/forms.py @ 100:eb9f99382476

Forums: groups support. Some experimentation with select_related() to reduce queries. There are more opportunities for this, see the TODO comments in views.py.
author Brian Neal <bgneal@gmail.com>
date Tue, 15 Sep 2009 03:15:20 +0000
parents 93d9e74a471e
children e67c4dd98db5
comparison
equal deleted inserted replaced
99:10d6182b9f6e 100:eb9f99382476
30 js = settings.GPP_THIRD_PARTY_JS['markitup'] + \ 30 js = settings.GPP_THIRD_PARTY_JS['markitup'] + \
31 ('js/forums.js', ) 31 ('js/forums.js', )
32 32
33 def clean_topic_id(self): 33 def clean_topic_id(self):
34 id = self.cleaned_data['topic_id'] 34 id = self.cleaned_data['topic_id']
35 print '*********', id
36 try: 35 try:
37 self.topic = Topic.objects.get(pk=id) 36 self.topic = Topic.objects.get(pk=id)
38 print '******** Got a topic'
39 except Topic.DoesNotExist: 37 except Topic.DoesNotExist:
40 raise forms.ValidationError('invalid topic') 38 raise forms.ValidationError('invalid topic')
41 return id 39 return id
42 40
43 def save(self, user, ip=None): 41 def save(self, user, ip=None):