Could you just specify the data in the URL that you redirect to? mike
Jay Parlar wrote: > On 5/2/08, Jay Parlar <[EMAIL PROTECTED]> wrote: >> I must be missing something super obvious here, but I can't figure out >> how to pass data to a new view, from the old one. >> >> For example, I have the following in a view: >> >> categories = [1,2,3] >> return HttpResponseRedirect( >> reverse('question-select', >> >> args=[position_id],kwargs={'categories':categories})) >> >> >> A URL pattern of: >> >> url(r'^(?P<position_id>\d+)/question-select/$', >> choose_questions,kwargs={'categories':None}, name='question-select' ), >> >> >> And a 'choose_questions' view of: >> >> def choose_questions(request, position_id, categories=None): >> ... >> >> >> I would *love* to have the value of 'categories' in 'choose_questions' >> be [1,2,3], the value I passed to reverse(). However, this isn't >> happening. What, if any, is the proper way to pass extra context to a >> view like this? > > > Wait a sec, I'm crazy, aren't I... The call to HttpResponseRedirect is > just going to tell the browser to redirect to a new URL, so there's no > direct calling of the view function. Oops. > > If anyone has a better way to do it, I'd like to hear. I guess for now > I'll use sessions. > > Jay P. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---