#13659: Make the request accessible in callables used in ModelAdmin.list_display
---------------------------------+------------------------------------
Reporter: Sebastian Noack | Owner: Paulo
Type: New feature | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Comment (by Dominik Bartenstein):
Replying to [comment:14 Tim Graham]:
> No, storing state on the `ModelAdmin` class isn't thread-safe.
Thanks a lot for the quick answer, Tim!
What approach do you recommend when the request object is to be considered
in a callable used with list_display?
There is middleware such as https://github.com/jedie/django-
tools/blob/master/django_tools/middlewares/ThreadLocal.py
Use case:
In the callable used with list_display the user’s permissions for each
object have to be checked. Thus we need access to request.user.
--
Ticket URL: <https://code.djangoproject.com/ticket/13659#comment:15>
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/073.beaa3c2b7afc5c76706d5115b915a931%40djangoproject.com.