MCPcopy
hub / github.com/django/django / Action

Class Action

django/contrib/admin/options.py:100–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99@dataclass
100class Action:
101 func: Callable
102 name: str
103 description: str
104 plural_description: str
105 locations: list
106
107 # RemovedInDjango70Warning.
108 def _as_tuple(self):
109 return (self.func, self.name, self.description)
110
111 # RemovedInDjango70Warning.
112 def __iter__(self):
113 warnings.warn(
114 "Unpacking an action tuple is deprecated. Use Action attributes instead.",
115 RemovedInDjango70Warning,
116 skip_file_prefixes=django_file_prefixes(),
117 )
118 return iter(self._as_tuple())
119
120 # RemovedInDjango70Warning.
121 def __getitem__(self, index):
122 warnings.warn(
123 "Using indexes on an action tuple is deprecated. "
124 "Use Action attributes instead.",
125 RemovedInDjango70Warning,
126 skip_file_prefixes=django_file_prefixes(),
127 )
128 return self._as_tuple()[index]
129
130
131HORIZONTAL, VERTICAL = 1, 2

Callers 2

_get_base_actionsMethod · 0.70
get_actionMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected