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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:23:11+00:00 2026-05-16T08:23:11+00:00

I want to delete the records which i select, and run.html will refresh, how

  • 0

I want to delete the records which i select, and run.html will refresh, how can i do that?
Since i use function run in views.py to send records in database, and run need one parameter build which can be got by using run.name, so i think i need to pass “run.name” and “run.id” when i click the submit button.

urls.py

urlpatterns = patterns('',
    (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    (r'^home/$', 'views.home'),
    (r'^home/(?P<build>[^/]+)/$', 'views.run'),
    (r'^run/delete/$', 'views.runDelete')
)

run.html

<form name="form" method="post" action="/run/delete">
<input type="submit" value="Delete" style="margin-left:149px; width:80px; height:30px">
<table border="1"; borderColor=black>
<td></td>
<td><b>Run</b></td>
    {% for run in run_list %}
        <tr>
        <td><input type="checkbox" name="var_delete" value="{{run.id}}"></td>
        <td>{{run.name}}</td>
        </tr>
    {% endfor %}
    </table>
    </form>

views.py

def run(request, build):   
    run_list = TestRun.objects.all().order_by('id')
    return render_to_response('run.html', {'run_list': run_list})

def runDelete(request, id, build):
    TestRun.objects.get(id=id).delete()
    run()

i also want to ask if i select multiple record in run.html, whether should i write a forloop in runDelete to delete all of them?

thanks 😀

  • 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-16T08:23:12+00:00Added an answer on May 16, 2026 at 8:23 am

    You should definitely take a look at Django Form

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

Sidebar

Related Questions

I want to delete multiple records at once. I have two tables, one that
I want to be able to use a varable table to delete records from
I have a table with about 100k records and I want to delete some
If I delete a record from the Parent table I want the corresponding records
Hey guys i wrote a quick test. I want delete to call deleteMe which
i have a table that somehow got duplicated. i basically want to delete all
I want to delete all records from wp_usermeta with user_id whose meta_value is tonetone
I have a DomainService which I am trying to delete records from. Assuming the
i have function which is something like this function multiple_delete($entity1,$entity2,$entity2) { $query = SELECT
I have a datalist with a OnDeleteCommand=Delete_Command. I want the delete a record with

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.