comparison gpp/forums/forms.py @ 111:e5faf9f0c11a

Forums: implemented the bulk moderator functions that operate on a forum: bulk sticky, lock, delete, and move. These haven't been tested that well yet.
author Brian Neal <bgneal@gmail.com>
date Mon, 28 Sep 2009 03:57:09 +0000
parents c329bfaed4a7
children d1b0b86441c0
comparison
equal deleted inserted replaced
110:c329bfaed4a7 111:e5faf9f0c11a
107 js = settings.GPP_THIRD_PARTY_JS['markitup'] + \ 107 js = settings.GPP_THIRD_PARTY_JS['markitup'] + \
108 ('js/forums.js', ) 108 ('js/forums.js', )
109 109
110 110
111 class MoveTopicForm(forms.Form): 111 class MoveTopicForm(forms.Form):
112 """ 112 """
113 Form for a moderator to move a topic to a forum. 113 Form for a moderator to move a topic to a forum.
114 """ 114 """
115 forums = forms.ModelChoiceField(label='Move to forum', 115 forums = forms.ModelChoiceField(label='Move to forum',
116 queryset=Forum.objects.none()) 116 queryset=Forum.objects.none())
117 117
118 def __init__(self, user, *args, **kwargs): 118 def __init__(self, user, *args, **kwargs):
119 super(MoveTopicForm, self).__init__(*args, **kwargs) 119 hide_label = kwargs.pop('hide_label', False)
120 self.fields['forums'].queryset = \ 120 required = kwargs.pop('required', True)
121 Forum.objects.forums_for_user(user).order_by('name') 121 super(MoveTopicForm, self).__init__(*args, **kwargs)
122 self.fields['forums'].queryset = \
123 Forum.objects.forums_for_user(user).order_by('name')
124 if hide_label:
125 self.fields['forums'].label = ''
126 self.fields['forums'].required = required
127 print '#############', required
122 128