Fixed #9507 -- Correct an example in the admin docs. Thanks, john_scott and

SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9432 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-11-14 07:49:51 +00:00
parent 40976e0862
commit 599852d04d
1 changed files with 2 additions and 2 deletions

View File

@ -262,7 +262,7 @@ You have four possible values that can be used in ``list_display``:
example:: example::
def upper_case_name(obj): def upper_case_name(obj):
return "%s %s" % (obj.first_name, obj.last_name).upper() return ("%s %s" % (obj.first_name, obj.last_name)).upper()
upper_case_name.short_description = 'Name' upper_case_name.short_description = 'Name'
class PersonAdmin(admin.ModelAdmin): class PersonAdmin(admin.ModelAdmin):
@ -275,7 +275,7 @@ You have four possible values that can be used in ``list_display``:
list_display = ('upper_case_name',) list_display = ('upper_case_name',)
def upper_case_name(self, obj): def upper_case_name(self, obj):
return "%s %s" % (obj.first_name, obj.last_name).upper() return ("%s %s" % (obj.first_name, obj.last_name)).upper()
upper_case_name.short_description = 'Name' upper_case_name.short_description = 'Name'
* A string representing an attribute on the model. This behaves almost * A string representing an attribute on the model. This behaves almost