diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-04-25 22:06:41 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-04-25 22:06:41 -0400 |
commit | b687846b99efda0ef69fb73084d3f64d5b6ddcb1 (patch) | |
tree | 0960c1e2135fddc45ee72fe424d24ea261ebb858 /forum/forms.py | |
parent | f7c685c68c503119b4ff7541a06337613bfce137 (diff) | |
download | askbot-b687846b99efda0ef69fb73084d3f64d5b6ddcb1.tar.gz askbot-b687846b99efda0ef69fb73084d3f64d5b6ddcb1.tar.bz2 askbot-b687846b99efda0ef69fb73084d3f64d5b6ddcb1.zip |
page size selector works again - some changes in templates
Diffstat (limited to 'forum/forms.py')
-rwxr-xr-x | forum/forms.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/forum/forms.py b/forum/forms.py index 4139abb8..e0452d82 100755 --- a/forum/forms.py +++ b/forum/forms.py @@ -139,7 +139,7 @@ class AdvancedSearchForm(forms.Form): start_over = forms.BooleanField(required=False) tags = forms.CharField(max_length=256,required=False) author = forms.IntegerField(required=False) - page_size = forms.ChoiceField(choices=const.PAGE_SIZES, required=False) + page_size = forms.ChoiceField(choices=const.PAGE_SIZE_CHOICES, required=False) page = forms.IntegerField(required=False) def clean_tags(self): @@ -170,6 +170,10 @@ class AdvancedSearchForm(forms.Form): if 'page_size' in self.cleaned_data: if self.cleaned_data['page_size'] == '': self.cleaned_data['page_size'] = None + else: + page_size = self.cleaned_data['page_size'] + #by this time it is guaranteed to be castable as int + self.cleaned_data['page_size'] = int(page_size) return self.cleaned_data['page_size'] def clean(self): |