Opened 13 years ago
Closed 13 years ago
#17317 closed Uncategorized (invalid)
lists stored in session becomes not changed (by pop() or del) in next request
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Generic views | Version: | 1.2 |
Severity: | Normal | Keywords: | pop session |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
i stored small list in session
v = Tests.objects.values_list('number', flat=True).filter(test=test,ticket=nomera).order_by('number') request.session['tests-cards'] = list(v)
and want to obtain one element per request.
this don`t write session:
def get_next(request): card=request.session['tests-cards'].pop(0) ...
and this so:
def get_next(request): card=request.session['tests-cards'][0] del request.session['tests-cards'][0] ...
this works:
def get_next(request): card=request.session['tests-cards'].pop(0) request.session['tests-cards']=request.session['tests-cards'] ...
bug or not?
Note:
See TracTickets
for help on using tickets.
Replying to oddghost@…:
No, please read documentation first.