Closed
Description
Proposed Changes
ActionsMixin
defines two attributes on a view:
actions
- A tuple of support action namesaction_perms
- A dictionary mapping of action names to a set of required permissions for each
The following actions are defined by default:
actions = ('add', 'import', 'export', 'bulk_edit', 'bulk_delete')
action_perms = defaultdict(set, **{
'add': {'add'},
'import': {'add'},
'bulk_edit': {'change'},
'bulk_delete': {'delete'},
})
These can be combined into a single mapping:
actions = {
'add': {'add'},
'import': {'add'},
'export': set(),
'bulk_edit': {'change'},
'bulk_delete': {'delete'},
}
Justification
This change will simplify the list of support actions for a view and reduce duplicate code.