hello every one:

I have a simple question about list_display feature of Django's admin
site

http://www.djangoproject.com/documentation/model-api/#admin-options

class
Person(models.Model):
    first_name =
models.CharField(max_length=50)
    color_code =
models.CharField(max_length=6)

    class
Admin:
        list_display = ('first_name',
'colored_first_name')

    def
colored_first_name(self):
        return '<span style="color: #%s;">%s</span>'
%
                (self.color_code,
self.first_name)
    colored_first_name.allow_tags =
True
    colored_first_name.admin_order_field = 'first_name'

It is about how to use color in list_display.
When i use it, I didn't correctly get the colored field of
first_name.
Only get strings like '<span style="color: #%s;">%s</span>'  in this
field.
Is there anything I misunderstand to make it work correctly?

thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to