Hello everyone! 


I have been looking into the implementation of ModelAdmin and how it 
processes the view only permission. While rendering a ModelAdmin for a user 
with view-only permission, the ModelAdmin disregard widget defined for the 
field and uses the AdminReadonlyField 
<https://github.com/django/django/blob/155e06a50b7b65a7bb3c888ae51bdf1a2bd1a1e2/django/contrib/admin/helpers.py#L116-L121>
 to 
display the information. 


This implementation makes it difficult to customize the rendering of the 
object information. An example use case is rendering map for GeoJSON 
coordinates in django-lealet 
<https://github.com/makinacorpus/django-leaflet/issues/85>. 


I have already read discussions in 
https://code.djangoproject.com/ticket/17295 ticket and also checked related 
discussions on this mailing list. I couldn't find a discussion on how 
ModelAdmins that use custom forms (or widgets for fields) could be 
supported for view-only permission. 


Will adding support for customizing the rendering of ModelAdmin for users 
with view-only permissions be useful for Django? 


Best, 

Gagan Deep 

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/b85b8330-3180-46e4-9b46-1b3cd8124295n%40googlegroups.com.

Reply via email to