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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:25:55+00:00 2026-05-23T17:25:55+00:00

basic problem: i need to create real customized templates for my django forms. That’s

  • 0

basic problem: i need to create real customized templates for my django forms. That’s it. I’m used to style the forms based on django’s output. This time is different, the html/css template is already done (months before i was hired) and i cannot modify it, so i need django to output exactly that html code.

I’ve read a lot throu django docs, and i found a lot, but i have to admit, i couldn’t put bits and pieces togheter, with order, to do what i need to do.

Now, with CheckboxSelectMultiple the html output is this:

<ul>
   <li><input type='checkbox' ...></li>
   ...
</ul>

What i actually need to do is create something like CustomCheckboxSelectMultiple to output exactly this template:

<ul class="list">
    <li class="list-item"><input class="checkbox" type="checkbox" id="..." /><label class="label" for="">...</label></li>
...
</ul>

And so on for other types of form widgets. It’s the only way i can think of to create my forms with that particular layout they gave me.

I’m actually stuck on this, i cannot seem to be able to put everything togheter to start coding my forms.
How can i manage this? If you have any example too, it will be great! Otherwise, just point me towards the right direction please… sadly, looking in the docs, as i said before, didn’t actually help me

Thanks all in advance!

  • 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-23T17:25:55+00:00Added an answer on May 23, 2026 at 5:25 pm

    you should subclass the CheckboxSelectMultiple class and override the render method as in:

    class CustomCheckboxSelectMultiple (CheckboxSelectMultiple):
        """
        A custom CheckboxSelectMultiple Widget that render specific html
        """
        def __init__(self, attrs={}):
            super(CustomCheckboxSelectMultiple, self).__init__(attrs)
    
        def render(self, name, value, attrs=None):
            #Here the custom code
    

    See original CheckboxSelectMultiple source for inspiration of how to make your new method.

    After that your signal the overriding in your Form

    class MyCustomForm(forms.Form):
        formfield_overrides = {
            models.CheckboxSelectMultiple : {'widget': CustomCheckboxSelectMultiple }
        }
    

    And now all your MyCustomForm will use your specific widget for all CheckboxSelectMultiple in it.

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

Sidebar

Related Questions

I want to create a timesheet application where I need an application that will
I'm using boost::ptree for parsing fils. The problem is that I can't create the
The basic problem is like this: A subscriber has successfully replicated a row from
The problem is quite basic. I have a JTable showing cached data from a
I've recently come across a problem which requires at least a basic degree of
I'm trying to do some basic paging in MSSQL. The problem I'm having is
Basic question : How to I create a bidirectional one-to-many map in Fluent NHibernate?
I need to create general actions menu for my pages. All of pages will
As a fairly junior developer, I'm running into a problem that highlights my lack
I'm trying create a gantt chart with highcharts and I need to put the

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.