#17317: lists stored in session becomes not changed (by pop() or del) in next
request
-------------------------------+-------------------------
Reporter: oddghost@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Generic views | Version: 1.2
Severity: Normal | Keywords: pop session
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-------------------------
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?
--
Ticket URL: <https://code.djangoproject.com/ticket/17317>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.