dj_angles.mappers.mapper ======================== .. py:module:: dj_angles.mappers.mapper Module Contents --------------- .. py:data:: TAG_NAME_TO_DJANGO_TEMPLATE_TAG_MAP :type: dict[Optional[str], Union[collections.abc.Callable, str]] Default mappings for tag names to Django template tags. .. py:data:: tag_map :type: Optional[TagMap] :value: None .. py:class:: TagMap Bases: :py:obj:`collections.UserDict` A MutableMapping is a generic container for associating key/value pairs. This class provides concrete generic implementations of all methods except for __getitem__, __setitem__, __delitem__, __iter__, and __len__. .. py:attribute:: data :type: dict[Optional[str], Union[collections.abc.Callable, str]] .. py:method:: add_custom_mappers() -> None Get custom mappers from settings and add it to the tag map. .. py:method:: add_default_mapper() -> None Add default mapper if in settings, or fallback to the default mapper. .. py:method:: import_strings() Try importing any values that are strings. .. py:method:: add_module_mapper(module: str, tag_name: str, mapper: Union[str, collections.abc.Callable]) -> None Add module mappers depending on whether it is installed or not. .. py:function:: get_tag_map() -> TagMap Get the complete tag map based on the default, dynamic, and settings mappers. .. py:function:: clear_tag_map() -> None Clear the generated tag map so that it will be re-generated. Useful for tests.