Changes between Initial Version and Version 1 of Ticket #22406, comment 2
- Timestamp:
- Jun 3, 2016, 5:22:54 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #22406, comment 2
initial v1 7 7 Now the view works as follows: 8 8 9 - check if the vote of a given type already exists for a given user. This is an unique triple : `Vote.filter(booleanfield=request.POST['booleanfield'])`9 - 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 10 - if yes, delete it 11 11 - else, get the existing vote `vote`, and create or update it. This means a form validation: `form = Vote(request.POST, instance=vote)`