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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:19:16+00:00 2026-05-28T02:19:16+00:00

I am in the process of revisiting Python web development and I am building

  • 0

I am in the process of revisiting Python web development and I am building out a simple CRUD application that sits on top of a Neo4J database. In the UI I do the following

delete.html

<Form method="post">  
   {% for book in books %}  
      {{ book.title }} 
      <input type=hidden name="id" value="{{ book.id}}" />  
      <input type=submit value="Delete" />  
      <br>  
   {% end %}  
</Form> 

Python code:

class DeleteHandler(tornado.web.RequestHandler):  
    def post(self):  
      bookToDelete = self.get_argument("id")  

The issue I have is that it will only take the most recent “id” I realize that this is because the variable is overwritten on each pass of the loop. My question is how do I store the “id” on the page for each book that is to potentially be deleted.

  • 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-28T02:19:17+00:00Added an answer on May 28, 2026 at 2:19 am

    I think the easiest solution in your case is to move the <form> inside of the {% for book in books %} loop, so that each delete button is actually a separate form, giving you only the id of the book you actually want to delete.

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

Sidebar

Related Questions

I process a lot of text/data that I exchange between Python, R, and sometimes
There is a conversion process that is needed when migrating Visual Studio 2005 web
I'm in the process of weeding out all hardcoded values in a Java library
Our process for creating a new development (get latest, setup db, setup IIS directories
The process is pretty simple -- I want to take an image as input,
I am in the process of testing a web dav enabled view my system
I have 1 process that receives incoming connection from port 1000 in 1 linux
The process is explained here: http://msdn.microsoft.com/en-US/library/d1ae6tz5%28v=VS.80%29.aspx What I don't get from that article is
Every process running on a machine is given the illusion that it is the
The process for releasing my application to the client is per the heading Build

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.