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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:26:22+00:00 2026-05-26T00:26:22+00:00

In the Django admin if the field is a BooleanField or NullBooleanField, Django will

  • 0

In the Django admin if the field is a BooleanField or NullBooleanField, Django will display a pretty “on” or “off” icon instead of True or False.

Now, I don’t really have a BooleanField in my model by I do have a property fior which I’d like to display the icons but when I try doing so, Django screams that 'SomeAdmin.list_filter[0]' refers to 'is_activated' which does not refer to a Field.

Is it possible to display those nice little icons for this field without hacking Django too much.

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-26T00:26:23+00:00Added an answer on May 26, 2026 at 12:26 am

    You don’t want to use list_filter. The property you’re looking for is list_display. The documentation offers an example of how you can create a column that behaves like a boolean in the display. In short, you do something like this:

    1. Create a method in the class:

      def is_activated(self)
          if self.bar == 'something':
              return True
          return False
      
    2. add the .boolean method attribute directly below the is_activated method:

      is_activated.boolean = True
      
    3. Add the method as a field in list_display:

      class MyAdmin(ModelAdmin):
      list_display = [‘name’, ‘is_activated’]

    4. You’ll notice the column name is probably now “Is Activated” or something like that. If you want the column heading to change, you use the short_description method attribute:

      is_activated.short_description = "Activated"
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I could translate Django Admin except a model label because I don't know how
I know that if I need a custom selector for a field in django-admin
Possible Duplicate: Override django-admin edit form field values for encrypted data The inline model
Is there a widget for rendering a foreign key field in Django admin that
In Django Admin interface, Whenever there is a change in a specific field of
I have a Django admin form. And now I want to fill it's initial
In Django admin, how can I increase the width of the ManyToMany field's widget
I want to add a text next to a field of the django admin
I try to display and add comment using Django admin, but Comment model use
For some of my models, Django-admin, in the index of the model's objects, instead

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.