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

  • Home
  • SEARCH
  • 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 7570803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:30:42+00:00 2026-05-30T15:30:42+00:00

This is my forms.py file: from django import forms class MusicCheckboxForm(forms.Form): songs = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple())

  • 0

This is my forms.py file:

from django import forms

class MusicCheckboxForm(forms.Form):
    songs = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple())

I want use the forms.py file to produce the multi-columns table with the checkbox insert to the first column, But I don’t want hard code <input type="checkbox" ...> to the template.
And I want the multi-columns look like this:

All song artist album genre date
[]  aaa  Smith  fdaf  rock 2001
[]  bbb  Davis  fdsaf blue 2002
[]  ccc  Doe    dfaj  sjaf 2000

The snippet of my template looks like this:

<table class="list" summary="musics">
  <caption>
    music list
  </caption>
  <tr>
    <th>All</th>
    <th>song</th>
    <th>artist</th>
    <th>album</th>
    <th>genre</th>
    <th>date</th>
  </tr>
  {% for info in all_info %}
  <tr>
    <td>
      <!-- I want put checkbox here -->
    </td>

    {% if info|hasattr:"title" %}
      <td>{{ info.title }}</td>
    {% else %}
      <td></td>
    {% endif %}

    {% if info|hasattr:"artist" %}
      <td>{{ info.artist }}</td>
    {% else %}
      <td></td>
    {% endif %}

    {% if info|hasattr:"album" %}
      <td>{{ info.album }}</td>
    {% else %}
      <td></td>
    {% endif %}

    {% if info|hasattr:"genre" %}
      <td>{{ info.genre }}</td>
    {% else %}
      <td></td>
    {% endif %}

    {% if info|hasattr:"date" %}
      <td>{{ info.date }}</td>
    {% else %}
      <td></td>
    {% endif %}
  </tr>
  {% endfor %}
</table>
  • 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-30T15:30:44+00:00Added an answer on May 30, 2026 at 3:30 pm

    django-tables2 simplifies transforming data into HTML tables. It does for HTML tables what django.forms does for HTML forms..

    See this : http://django-tables2.readthedocs.org/en/latest/index.html

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

Sidebar

Related Questions

This is my form: from django import forms class UploadFileForm(forms.Form): titl = forms.CharField(max_length=50) ffile
Here's the code for my view.py file: from django import forms def student(request): id
I have installed django-registration with pip, version 0.7. Then with urls.py from core.forms import
what this exception: System.MissingMethodException was unhandled Message: File or assembly name 'System.Windows.Forms, Version=3.5.0.0, Culture=neutral,
I have this on my web.config file: <authentication mode=Forms> <forms loginUrl=login.aspx defaultUrl=Venues.aspx /> </authentication>
I am using this form as a file upload form(as part of a larger
i have form action file in another directory but some file send to this
In this question I asked how to POST to a php file form a
I am loading a file into a array in binary form this seems to
I'm rather new to Django and I'm using Django 1.0. I have this: forms.py:

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.