Feature request: A standardised API to allow developers to customise model edit forms based on the current user
See original GitHub issueIssue Summary
In Django ModelAdmin
there’s a get_field_queryset(self, db, db_field, request)
method, which allows the filtering of items displayed in the aforementioned fields based on the request
.
In the Wagtail ModelAdmin
such method does not exist.
Is there a way to achieve a similar functionality as with Django get_field_queryset()
?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Apply Edits (Feature Service)—ArcGIS REST APIs
This allows an editor to apply a single block of edits partially, complete another task, and then complete the block of edits. When...
Read more >RESTful web API design - Best Practices - Microsoft Learn
As the API evolves, existing client applications should continue to function without ... REST APIs use a stateless request model.
Read more >Django Tutorial Part 9: Working with forms - MDN Web Docs
Objective: To understand how to write forms to get information from users and update the database. To understand how the generic class-based ......
Read more >What is an Application Programming Interface (API)? - IBM
Application programming interfaces, or APIs, simplify software development by enabling applications to exchange data and functionality ...
Read more >lightning-record-edit-form - Salesforce Developers
Use the lightning-record-edit-form component to create a form that's used to add a Salesforce record or update fields in an existing record on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In addition to the above, I think it might also be nice to bring in some additional flexibility to the
get_edit_handler()
method onPage
, by allowing it to accept optionalobject
andrequest
arguments (a bit more like the version on theModelAdmin
class:https://github.com/wagtail/wagtail/blob/master/wagtail/contrib/modeladmin/options.py#L399), and trying to be consistent about providing those values in the various editing UIs. This would make it easier to do things like following (all of which I have done at some point):@gasman I have renamed/reopened this as, following a discussion on Slack, I feel it makes sense to have a ticket here to discuss (if anything) what we can do to provide a better API for this.