diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-04-24 21:40:09 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-04-24 21:40:09 -0400 |
commit | 1eadbe31fc08f32f3fc082f9f4474951e9f68abd (patch) | |
tree | a2214f93eaa3b22b242aef873acd9ce2b4233e72 /forum/views/readers.py | |
parent | 3b8821b7e6c00a34fe71b22f011841786bb9d7e5 (diff) | |
download | askbot-1eadbe31fc08f32f3fc082f9f4474951e9f68abd.tar.gz askbot-1eadbe31fc08f32f3fc082f9f4474951e9f68abd.tar.bz2 askbot-1eadbe31fc08f32f3fc082f9f4474951e9f68abd.zip |
first pass on mysql full text and relaxed search stickiness
Diffstat (limited to 'forum/views/readers.py')
-rw-r--r-- | forum/views/readers.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/forum/views/readers.py b/forum/views/readers.py index 7fd30a25..89a9550b 100644 --- a/forum/views/readers.py +++ b/forum/views/readers.py @@ -78,10 +78,12 @@ def questions(request):#a view generating listing of questions, used by 'unanswe if request.method == 'POST': raise Http404 + #todo: redo SearchState to accept input from + #view_log, session and request parameters search_state = request.session.get('search_state', SearchState()) view_log = request.session['view_log'] - #print view_log + if view_log.get_previous(1) != 'questions': if view_log.get_previous(2) != 'questions': #print 'user stepped too far, resetting search state' @@ -91,8 +93,18 @@ def questions(request):#a view generating listing of questions, used by 'unanswe search_state.set_logged_in() form = AdvancedSearchForm(request.GET) + #todo: form is used only for validation... if form.is_valid(): - search_state.update_from_user_input(form.cleaned_data, request.GET) + search_state.update_from_user_input( + form.cleaned_data, + request.GET, + ) + #todo: better put these in separately then analyze + #what neesd to be done, otherwise there are two routines + #that take request.GET I don't like this use of parameters + #another weakness is that order of routine calls matters here + search_state.relax_stickiness( request.GET, view_log ) + request.session['search_state'] = search_state request.session.modified = True |