synopsis: | most ajax processors for askbot |
This module contains most (but not all) processors for Ajax requests.
Not so clear if this subdivision was necessary as separation of Ajax and non-ajax views
is not always very clean.
-
askbot.views.commands.close
view to initiate and process
question close
-
askbot.views.commands.read_message(request)
-
askbot.views.commands.reopen
view to initiate and process
question close
-
askbot.views.commands.vote(request, id)
todo: this subroutine needs serious refactoring it’s too long and is hard to understand
- vote_type:
- acceptAnswer : 0,
questionUpVote : 1,
questionDownVote : 2,
favorite : 4,
answerUpVote: 5,
answerDownVote:6,
offensiveQuestion : 7,
offensiveAnswer:8,
removeQuestion: 9,
removeAnswer:10
questionSubscribeUpdates:11
questionUnSubscribeUpdates:12
- accept answer code:
- response_data[‘allowed’] = -1, Accept his own answer 0, no allowed - Anonymous 1, Allowed - by default
response_data[‘success’] = 0, failed 1, Success - by default
response_data[‘status’] = 0, By default 1, Answer has been accepted already(Cancel)
- vote code:
- allowed = -3, Don’t have enough votes left
-2, Don’t have enough reputation score
-1, Vote his own post
0, no allowed - Anonymous
1, Allowed - by default
- status = 0, By default
- 1, Cancel
2, Vote is too old to be canceled
- offensive code:
- allowed = -3, Don’t have enough flags left
- -2, Don’t have enough reputation score to do this
- 0, not allowed
1, allowed
- status = 0, by default
- 1, can’t do it again