Add documentation for the lookup_allowed method
|Reported by:||3point2||Owned by:||nobody|
|Cc:||lemaire.adrien@…, zborboa@…||Triage Stage:||Accepted|
|Has patch:||no||Needs documentation:||yes|
|Needs tests:||no||Patch needs improvement:||no|
Right now, as a result of the security fix introduced in r15031, the only way to allow querystring lookups across relationships in the admin is to whitelist them by including them in list_filter.
However, in my application the lookup that needs to be whitelisted generates a huge filter widget as it contains thousands of instances.
It would be helpful if I could whitelist the exact lookup I need to link to without having to generate the filter widget itself.
class MyModelAdmin(ModelAdmin): allow_lookup = ["fieldname__id__exact"]
would do. If the developers agree this is useful functionality, I could write a patch.
Change History (8)
comment:3 Changed 5 years ago by
|Summary:||Add additional lookup_allowed whitelist functionality to ModelAdmin → Add documentation for the lookup_allowed method|
|Triage Stage:||Unreviewed → Accepted|
comment:7 Changed 4 years ago by
|Triage Stage:||Design decision needed → Accepted|