Convert pydantic ``__all__`` special index into the ormar form, which does not support index-based exclusions. :param items: current include/exclude value :type items: Union[set, dict, None] :return: items with ``__all__`` unwrapped if present :rtype: Union[set, dict, None]
(items: Union[set, dict, None])
| 40 | |
| 41 | |
| 42 | def convert_all(items: Union[set, dict, None]) -> Union[set, dict, None]: |
| 43 | """ |
| 44 | Convert pydantic ``__all__`` special index into the ormar form, which does |
| 45 | not support index-based exclusions. |
| 46 | |
| 47 | :param items: current include/exclude value |
| 48 | :type items: Union[set, dict, None] |
| 49 | :return: items with ``__all__`` unwrapped if present |
| 50 | :rtype: Union[set, dict, None] |
| 51 | """ |
| 52 | if isinstance(items, dict) and "__all__" in items: |
| 53 | return items.get("__all__") |
| 54 | return items |
| 55 | |
| 56 | |
| 57 | def normalize_to_dict(items: Union[set, dict, None]) -> Optional[dict]: |
no test coverage detected