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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:55:35+00:00 2026-06-05T08:55:35+00:00

I have declared a table and want to fetch the row’s value which is

  • 0

I have declared a table and want to fetch the row’s value which is checked using checkboxfield. Any help, how can i write this event in my views so that everytime I select a row and hit submit button, it returns the row’s values.Code goes like this:

    class mytables(tables.Table):
          new_database = tables.CheckBoxColumn()
          student =tables.Column(accessor='Student')
          Class = tables.Column(accessor='class')

And in my templates a submit button.

  • 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-05T08:55:36+00:00Added an answer on June 5, 2026 at 8:55 am

    You need to choose a suitable value for the CheckBoxColumn. Generally if you’re displaying a queryset, you’ll use the pk of each object for the CheckBoxColumn. In your case this would look like:

    class EnrollmentTable(tables.Table):
        selection = tables.CheckBoxColumn(accessor='pk')
        student = tables.Column()
        class = tables.Column()
    

    Then you’ll need to render the table within a form, so that the user can submit the form, e.g.:

    <form action="/someurl/" method="post">
        {% load render_tables from django_tables2 %}
        {% render_table table %}
        <input type="submit"/>
    </form>
    

    Then you’ll need a view hooked up to /someurl/. In your case the view will need to look at the POST variable selection:

    def someview(request):
        if request.method == "POST":
            pks = request.POST.getlist("selection")
            selected_objects = SomeModel.objects.filter(pk__in=pks)
            # do something with selected_objects
        else:
            # ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table layout in which i have declared a button statically in
I have declared one variable in xslt, assigned some value to it but while
I have the following table structure. I want to select distinct CustomerId and CustomerName
I have my default schema declared in persistence.xml as: <property name=hibernate.default_schema value=MYSCHEMA /> However,
Currently I have a column that is declared as a NUMBER. I want to
I currently have a single DataSet declared which contains 3 tables. For sake of
I use jsp and sql and I want to query a table using a
I have a table in my database with one field declared as _id integer
I really hate when I want to store/fetch something from the database, I have
in context of SQL Server 2005, I have a table for which the primary

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.