Changes between Version 1 and Version 2 of Ticket #22406, comment 2


Ignore:
Timestamp:
Jun 3, 2016, 5:24:53 PM (8 years ago)
Author:
Ciro Santilli 六四事件 法轮功 包卓轩

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22406, comment 2

    v1 v2  
    88
    99- check if the vote of a given type already exists for a given user. This is an unique triple. This step runs: `Vote.filter(booleanfield=request.POST['booleanfield'])`
    10 - if yes, delete it
    11 - else, get the existing vote `vote`, and create or update it. This means a form validation: `form = Vote(request.POST, instance=vote)`
     10- if the exact same vote exists, delete it
     11- if it exists but with a different value (up or down vote), get the existing vote `vote`, and update it. This means a form validation: `form = Vote(request.POST, instance=vote)`
    1212
    1313So now, what should my AJAX send?
Back to Top