Hello, I want to create a list that can be updated from within a part of a view and retreived from another part of a view. Here is my view.py file
from django.shortcuts import render_to_response, get_object_or_404 mysearchlist = [] def searchresult(request): if request.method == 'POST': mysearchlist = [1,2,3,4,5] if request.method == 'GET': assert False, mysearchlist Here is basically my view (I've taken out most of the text). The post will always be called first. So I want my code from within the post to update my global variable 'mysearchlist'. Then when I get to the assert statement from within the GET I won't get the error: UnboundLocalError at /plush/searchresult/ local variable 'mysearchlist' referenced before assignment /////////////// Does anybody know to do this? Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---