comparison apps/snippet/forms.py @ 207:d534881629ff

Updated snippet's template and views files to fix rating code collision which prevented posting new snippets. Updated snippet's models file so that now secret id of each snippet will be unique. It also means that the no two or more than two snippets will have same secret id.
author Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
date Mon, 19 Aug 2013 20:30:19 +0500
parents 499e5f47f278
children
comparison
equal deleted inserted replaced
206:1f1e867cb37f 207:d534881629ff
33 initial=EXPIRE_DEFAULT, 33 initial=EXPIRE_DEFAULT,
34 label=_(u'Expires'), 34 label=_(u'Expires'),
35 ) 35 )
36 36
37 37
38 form_choices = ( (x,x) for x in range(1,6) )
39 Rate = forms.ChoiceField(form_choices,widget=forms.RadioSelect(attrs={'onclick' :"document.getElementById('rate_form').submit();","class":"rate_radio"}))
40 38
41 def __init__(self, *args, **kwargs): 39 def __init__(self, *args, **kwargs):
42 request = kwargs.pop('request') 40 request = kwargs.pop('request')
43 super(SnippetForm, self).__init__(*args, **kwargs) 41 super(SnippetForm, self).__init__(*args, **kwargs)
44 self.request = request 42 self.request = request