Hello everyone!
I have created a demo project to convey my use case programmatically. Here is a brief description of the project.
The Django project contains an application "home" that has four models: Device, Location, FloorPlan and DeviceLocation. DeviceLocation is a thorough model that connects Device model to FloorPlan and Location using GenericForeignKey.
The "home" application registers ModelAdmin classes for Device, FloorPlan and Location models. An InlineAdmin is present for the DeviceLocation model which is added to DeviceAdmin (ModelAdmin class for Device model). DeviceLocationInlineAdmin uses a custom form (DeviceLocationForm) to display fields from related Location models.
Problem
If a staff user has view-only permission to all the models (Device, FloorPlan, Location and DeviceLocation), then the content of DeviceLocationForm shows empty.
After giving change permission to both Device and DeviceLocation model, the form starts showing information.
I don't understand if there's some logic in ModelAdmin that is removing this information.
Warm wishes for a new year,
Gagan Deep
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6080d4c5-65b2-49d4-a6c7-56d6aa31c8fdn%40googlegroups.com.
No comments:
Post a Comment