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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:00:09+00:00 2026-05-26T04:00:09+00:00

For some of my models, Django-admin, in the index of the model’s objects, instead

  • 0

For some of my models, Django-admin, in the index of the model’s objects, instead of displaying the output of the __unicode__ method like normally, it just displays one of the model’s fields there.

This happens usually when there is something like:

class Meta:
    ordering = ['name']

in my model, then the value of the field name is displayed (even though there is also a __unicode__ method), but not always, sometimes it just displays what __unicode__ says even if there is a class Meta ordering.

All my Unicode methods are quite normal, something like:

def __unicode__(self):
    return u'[%s] %s' % (self.field, self.name, )

I am puzzled, why is a field used sometimes instead of __unicode__, and how can I make it use the __unicode__ method always? This is Django 1.3. Is this a bug in Django?

  • 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-26T04:00:10+00:00Added an answer on May 26, 2026 at 4:00 am

    You can customise the fields displayed in the django admin using the list_display option in your ModelAdmin class.

    The model __unicode__ method, and the Meta.ordering option do not have any affect on the fields displayed.

    If you do not set list_display, then the default behaviour is to display a single column with the unicode string for each object.

    If the unicode string is not displayed for your model, it sounds like you have set list_display. For example, to display the name field instead of the unicode string, you would do:

    class MyModelAdmin(models.ModelAdmin):
        list_display = ['name'] 
    

    If you want to display the unicode string and other fields, simply include __unicode__ in list_display.

    class MyModelAdmin(models.ModelAdmin):
        list_display = [`__unicode__`, 'name'] 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have some django models, something like this: class Address(models.Model): pass class Person(models.Model):
Hi Everyone I m dealing with some serious issue in django-admin.I have created models
I have some Django models with a structure similar to this: class Grandparent(models.Model): name
I have a django application which has two models like this: class MyModel(models.Model): name
I would like to display the model's username in Django Admin interface but not
I'm trying to customize the Django Admin. models.py ============= class Question(models.Model): poll = models.ForeignKey(Poll)
I'm trying to figure out a way to serialize some Django model object to
I'm creating a text-based browser game and need some advice for django model structure.
How do I change some models name from Categorys to Categories on admin site
I have some models that are laid out like so (with a lot more

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.