Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6064133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:14:49+00:00 2026-05-23T09:14:49+00:00

I have a list in one view that I would like to pass to

  • 0

I have a list in one view that I would like to pass to another view to be parsed.
This is what I currently have.
The views:

def view1(request):
    if request.method=='POST':
        list = request.POST.values()
        HttpResponseRedirect('/urls/'+ str(list)) 

def view2(request, *list):
    #do something with list

the urls:

urlpatterns = patterns('',
    url(r'^urls/$', views.view1),
    url(r'^urls/(?P<list>[-/\w]+)$', views.view2),
)

so the questions are:

  1. how do I form the url regex to recognize the list
  2. how do I concatenate the list with the rest of the url in the HttpResponseRedirect so that it will read
  3. how do i pass the list in the second view (I vaguely remember using * last time I did this but I couldn’t find any useful reference material)

EDIT:
At the broader level I have a template and view which provide a list of objects in a form. Each object is selected by a checkbox. I have a second view and template that displays data for the selected objects from the first view. I would like the number of objects selected to not be finite or limited but that may not be an option.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:14:50+00:00Added an answer on May 23, 2026 at 9:14 am

    As Brandon suggested, posting to the second view was a usable solution.
    Something along the lines of:

    def view2(request):
        if request.method == 'POST':
            page_list=request.POST.values()
        else:
            HttpResponseRedirect('/urls/')
    

    and then no need for regex in the urls

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view that uses a list of modelitems like this: List<It4You.AlertBrick.Library.Domain.Order.AbOrderLineItemPicked> When
I've got some data in a view that I would like to pass to
What I have Currently I have a view that creates a list of entries,
Ho I have two list view on a frame layout. I want one overlay
I have one list that I want to take a slice of, reverse that
I have one spinner, and I am populating that. I have list of values
I would like to bind a list control (like a ListView) in a view
I would like to have filtering page that performs ajax requests to asynchronously update
Currently, I have a view that shows all my investments maturing within the next
I am passing a list to a view. My array looks like this: [football,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.