#24746: Add support for excluding callables in child ModelAdmin defined in its
super
---------------------------------+--------------------
     Reporter:  giuliettamasina  |      Owner:  nobody
         Type:  Uncategorized    |     Status:  new
    Component:  contrib.admin    |    Version:  master
     Severity:  Normal           |   Keywords:
 Triage Stage:  Unreviewed       |  Has patch:  0
Easy pickings:  0                |      UI/UX:  0
---------------------------------+--------------------
 If I have a super `ModelAdmin` class that defines `list_display` with some
 callable, there is no obvious way to have this callable in the `exclude`
 attribute in subclasses of the same `ModelAdmin`. See example:

 {{{#!python
 class ParentAdmin(admin.ModelAdmin):
     def my_callable(obj):
         # Some custom stuff here.
         return obj

     list_display = ('name', 'description', my_callable)

 class ChildAdmin(admin.ModelAdmin):
     exclude = ('description',) # I want to exclude my_callable but I
 can't!
 }}}

 I currently achieve this through weird hacks such as filtering the parent
 attribute to exclude items with a certain func_name, etc.

 Or am I missing something obvious?

--
Ticket URL: <https://code.djangoproject.com/ticket/24746>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/058.476185dcae4db591b3cddf36dcda1493%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to