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 8554419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:52:39+00:00 2026-06-11T14:52:39+00:00

update 0 Below is my template code. There is a potential collision in your

  • 0

update 0

Below is my template code.

There is a potential collision in your reservation at <emph style="font-weight: bold">{{ location_id }}</emph>
<br /><br />
<form action="/unexpected" method="post" >
       <input type="hidden" name="location_id" value="{{ location_id }}"></input>
       <input type="hidden" name="cases" value="{{ cases|safe }}"></input>
    <table border="1" cellpadding="2" 
      cellspacing="0" class="sortable" id="unique-id" align="center">
      <thead> 
<tr> 
<td>Time</td>
<td>Court</td>
<td>Currently signed up</td>
<td>You could sign up this person</td>
</tr></thead>

    <tbody>
    {% for time in times %}
<tr> 
    {% for column in time %}
    <td >
    {{ column|safe }}
    </td>
    {% endfor %}
</tr> 
{% endfor %}
    </tbody>
</table>
<div id="inputdata">

<label>Click the "Submit" button after selecting your option(s) above. Another option is to press the browser back button and then refresh/reload the page to see the current status without taking action here.
</label>
<input type="submit" value="submit" />
</div>
</form>

update 0

This question follows from this one

I have this def post() code.

    cases=[]
    for res in tempres:
        r = TempReservations.get_or_insert(time[2],parent=res[8], day = int(res[9]))
        r.hour = res[0][0]
        r.minute = res[0][1]
        r.time = res[0][2]
        r.name = res[4]
        r.hiddenname = res[5]
        r.court_id = res[6]
        r.weekday = res[7]
        r.weekday_key = str(res[8])
        r.put()

        cases.append(r.court_id+str(r.hour)+str(r.minute))
        tt=r.court_id+str(r.hour)+str(r.minute)
        logging.info("string: %s" % tt)
        logging.info("cases: %s" % cases)
        for case in cases:
            logging.info("case: %s" % case)
    template_values = {'times':times,'cases':cases,'location_id':location_id}
    path = os.path.join(TEMPLATE_DIR, 'collisions.html')
    self.response.out.write(template.render(path, template_values))

Which produces the following in the log.

INFO     2012-09-19 21:46:43,064 views.py:207] string: court11730
INFO     2012-09-19 21:46:43,064 views.py:208] cases: [u'court11730']
INFO     2012-09-19 21:46:43,064 views.py:210] case: court11730
INFO     2012-09-19 21:46:43,080 dev_appserver.py:2967] "POST /read/Rogers HTTP/1.1" 200 -

And the following post code gets the output of the submit button from the previous code
after the user has made a change requiring the code below.

def post(self):
    location_id=self.request.get('location_id')
    cases=self.request.get_all('cases')
    for case in cases:
        logging.info("cases: %s " % cases)
        logging.info("case: %s " % case)
        logging.info("kcase: %s " % 'k'+case)
        key=str(self.request.get('k'+case))
        logging.info("key: %s " % key)

And the log produced the following for this code.

INFO     2012-09-19 21:47:47,320 views.py:678] cases: [u"[u'court11730']"] 
INFO     2012-09-19 21:47:47,320 views.py:679] case: [u'court11730'] 
INFO     2012-09-19 21:47:47,320 views.py:680] kcase: k [u'court11730']
INFO     2012-09-19 21:47:47,320 views.py:682] key:  
ERROR    2012-09-19 21:47:47,321 webapp2.py:1553] Invalid string key .
  File "/Users/brian/googleapps/scheduler/views.py", line 684, in post
    res = Reservations.get(key)

Notice how in lines 208 way above, and in line 678 just above cases has changed and now seems to be a list in a list, instead of just a list, so that now case singular is a single list instead of a string. This causes the ERROR, I think.

  • 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-06-11T14:52:41+00:00Added an answer on June 11, 2026 at 2:52 pm

    To pass a list as hidden elements in a form you need to create a new <input type="hidden"/> element for each item in the list:

    <form action="/unexpected" method="post" >
    <input type="hidden" name="location_id" value="{{ location_id }}"/>
    {% for item in cases %}
      <input type="hidden" name="cases" value="{{ item }}" />
    {% endfor %}
    

    Note that <input /> elements must be empty elements (so use <../>) according to the HTML standard.

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

Sidebar

Related Questions

I use below code to update listview. setListAdapter(MyAdapter); MyAdapter.notifyDataSetChanged(); getListView().setEmptyView(empty); But each time update,
UPDATE - I have fixed some mistakes in the code below and the images
[Replaced code by a complete program and versions update] The code below fails under
* UPDATE : See final answer code in the last code block below. *
I have something like the following code you see below as a template. what
Update: I have tried Sheldon's code below but I have struck a couple of
While trying to compile the code below: template <class T> struct scalar_log_minimum { public:
UPDATE see below I am not sure how to populate a list or vector
NOTE: I added my new solution at the UPDATE answer below. I try to
I have a problem when trying to execute this update statement (below) using C#

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.