#24941: Add get_exclude() hook to BaseModelAdmin
-------------------------------+--------------------
     Reporter:  peterfarrell   |      Owner:  nobody
         Type:  New feature    |     Status:  new
    Component:  contrib.admin  |    Version:  master
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 TL;DR: Most attributes in the admin have get_XXX() hooks however exclude
 is missing this functionality. This ticket is to add get_exclude() hook to
 so it matches the same pattern of hooks the rest of the admin has.

 I have a patch in the works if accepted.
 --

 We're building out a custom admin base for CleanerVersion in which we
 subclass ModelAdmin.  We needed to dynamically get the developer's choices
 in exclude and add in our own without overwriting the developer's settings
 in their concrete class.  Just about all other attributes have their own
 hook method in order to get at attribute values, but exclude seems to be
 the only one that is doesn't follow this pattern.

 It is possible to "mock" this without having to override bunch of other
 methods by using a @property descriptor, but this causes the admin checks
 to throw an error when performing the check on exclude.  This is monkey
 patched by subclassing the admin checks class and overriding the check for
 exclude.  Less than ideal.

 Simple solution is add an get_exclude() method to the BaseModelAdmin so it
 offers the same hook methods that are available for list_display, fields,
 etc.

--
Ticket URL: <https://code.djangoproject.com/ticket/24941>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/055.9d4ed966da7da1f9169200d53fbedca1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to