| 98 | |
| 99 | @dataclass |
| 100 | class 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 | |
| 131 | HORIZONTAL, VERTICAL = 1, 2 |
no outgoing calls
no test coverage detected