Skip to content

RecordActionMixin

RecordActionMixin

djadmin.actions.base.RecordActionMixin

Mixin for actions that operate on a single record.

Record actions are displayed in ListView rows or on detail pages. The target record is passed to the action.

Examples

  • EditRecordAction (edit record)
  • DeleteRecordAction (delete record)
  • DuplicateAction (clone record)
  • ViewRecordAction (view record details)

Method Resolution Order

  1. djadmin.actions.base.RecordActionMixin

Attributes

Attribute Value Defined in
action_type record djadmin.actions.base.RecordActionMixin

Methods

get_url_pattern(self) -> str

Defined in: <class 'djadmin.actions.base.RecordActionMixin'>

Get URL pattern for this action.

Override this to customize the URL pattern for the action. Default pattern is: {app_label}/{model_name}//{action_class_name}/

Returns: URL pattern string (without leading slash)

Source code in base.py line 313
    def get_url_pattern(self) -> str:
        """
        Get URL pattern for this action.

        Override this to customize the URL pattern for the action.
        Default pattern is: {app_label}/{model_name}/<int:pk>/{action_class_name}/

        Returns:
            URL pattern string (without leading slash)
        """
        opts = self.model._meta
        return f'{opts.app_label}/{opts.model_name}/<int:pk>/{self.action_name}/'

Fields

Field Type Related To
__dict__ getset_descriptor -
__weakref__ getset_descriptor -