#33398: ModelAdmin.empty_value_display example in docs should use list_display.
--------------------------------------+------------------------------------
     Reporter:  Michael               |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  4.0
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  1                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by Mariusz Felisiak):

 IMO it's not important to mention `readonly_fields` in
 `ModelAdmin.empty_value_display` docs, it's already documented in the
 `display()` decorator. I would only change `fields` to `list_display`:
 {{{#!diff
 diff --git a/docs/ref/contrib/admin/index.txt
 b/docs/ref/contrib/admin/index.txt
 index 7b97ee5638..4449afaaa6 100644
 --- a/docs/ref/contrib/admin/index.txt
 +++ b/docs/ref/contrib/admin/index.txt
 @@ -249,7 +249,7 @@ subclass::
          from django.contrib import admin

          class AuthorAdmin(admin.ModelAdmin):
 -            fields = ('name', 'title', 'view_birth_date')
 +            list_display = ('name', 'title', 'view_birth_date')

              @admin.display(empty_value='???')
              def view_birth_date(self, obj):
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33398#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.8b1018940699a3abfeab8116ed3ae13f%40djangoproject.com.

Reply via email to