mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Move takes_child/takes_parent information from Action to Resource (#2567)
Simplified Action by moving takes_child/takes_parent logic to Resource - Removed InstanceResource - global actions are now simply those with resource_class=None - Resource.parent_class - Replaced parent_name: str with parent_class: type[Resource] | None for direct class references - Simplified Action dataclass - No more redundant fields, everything is derived from the Resource class structure - Validation - The __init_subclass__ method now checks parent_class.parent_class to enforce the 2-level hierarchy Closes #2563
This commit is contained in:
parent
1f8995e776
commit
5705ce0d95
10 changed files with 417 additions and 186 deletions
|
|
@ -23,6 +23,10 @@ UNDOCUMENTED_PERMISSIONS = {
|
|||
"this_is_allowed_async",
|
||||
"this_is_denied_async",
|
||||
"no_match",
|
||||
# Test actions from test_hook_register_actions_with_custom_resources
|
||||
"manage_documents",
|
||||
"view_document_collection",
|
||||
"view_document",
|
||||
}
|
||||
|
||||
_ds_client = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue