﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19122	Allow .warning and .error classes on more attributes in base.py	Daniele Procida	nobody	"In https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display there's an example:

{{{
class Person(models.Model):
    ...
    def colored_name(self):
        return '<span style=""color: #%s;"">%s %s</span>' % (self.color_code, self.first_name, self.last_name)
    colored_name.allow_tags = True

class PersonAdmin(admin.ModelAdmin):
    list_display = ('first_name', 'last_name', 'colored_name')
}}}

This sort of thing could be really useful for reporting potential problems in the admin, both in list views and with readonly_fields, if it were possible to use classes that already exist in base.css for errors and warnings: https://github.com/django/django/blob/master/django/contrib/admin/static/admin/css/base.css#L524 for some other HTML attributes as well (<span> for example).

At present the Django admin does very well at informing the user of errors when something is saved in the admin. With a bit of effort it's quite easy to provide warnings too.

Being able to make use of classes for warnings and errors would make it easier to give information to the user about problematic conditions that already exist through the standard Django admin.

Does this seem like a good idea?"	New feature	closed	Uncategorized	1.4	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
