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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:32:06+00:00 2026-06-09T07:32:06+00:00

My goal is to create a form that display multiple checkboxes and allows users

  • 0

My goal is to create a form that display multiple checkboxes and allows users to select one or more choices. All those choices need to be translated.

While using non-model driven form and CHOICES it works as expected.

COLOR_CHOICES = (
    (1, _('Red')),
    (2, _('Black')),
)

Since my form is model based instead of MultipleChoiceField I have to use ModelMultipleChoiceField.

colors = forms.ModelMultipleChoiceField(
    queryset=Colors.objects, # <- This needs to exist in the database so can't use CHOICES
    widget=forms.CheckboxSelectMultiple(),
    required=False
)

Since ModelMultipleChoiceField queries the database to get the choices I have to have the data in the database in the first place.

I can think of two solutions to this problems but I am not sure how to make it work (possibly there is a different approach I am not aware of):

  1. Create a fixture and translate it (translation is the problem here)

  2. Use choices for the queryset in ModelMultipleChoiceField

  • 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-09T07:32:08+00:00Added an answer on June 9, 2026 at 7:32 am

    You should translate Colors model. I send to you an active project that make easy the job: django-modeltranslation

    Learn more about this project is in my TODO list.

    Also, take a look to Dynamic Translation Apps for Django from muhuk.com blog.

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

Sidebar

Related Questions

My goal is to create an entry form (addnew.php) that will allow me to
My end goal is to create a checkbox that, when selected, checks all the
I want to create a donation form on my website that forwards donors to
I'm trying to create a very simple login for only one or two users,
I have a form that users fill out, and on the form there are
I am currently coding a web page that allows users to change local settings
My goal is to create an eBook that I can read with the Mobipocket
Is there a good way to create a form in VB6 that can easily
I have a form that has hidden elements in it to create a pseudo-array
My goal is to provide each of my users a web page that contains

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.