From c7984b38b3d061b22c5396da600695aeab20e57a Mon Sep 17 00:00:00 2001 From: Brandon Rodriguez <brodriguez8774@gmail.com> Date: Sun, 26 Jun 2022 06:46:42 -0400 Subject: [PATCH] Correct various references for datetime/intermediate type Should now be more consistent with what is actually going on. --- README.md | 5 ++++- django_dump_die/static/django_dump_die/css/dd.css | 2 +- .../django_dump_die/output_types/complex_type.html | 2 +- .../django_dump_die/partials/_custom_color_theme.html | 6 +++--- django_dump_die/templatetags/dump_die.py | 2 +- docs/source/configuration.rst | 5 ++++- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5bbac60..7df00fd 100644 --- a/README.md +++ b/README.md @@ -278,10 +278,13 @@ Some of these "intermediate type" variables have recurse an unhelpful number of When the tool encounters a defined intermediate type it will no longer recurse further and instead output a string representation as well as the direct attributes. For the sake of processing times, these attributes are not further expandable. Predefined intermediate types include: +* bytesarray +* complex number * datetime * date * time * timezone +* pathlib paths If you would like to add additional intermediate types that are specific to your project, you can do that here. Be sure to list each type in the list as a string of the type to treat as an intermediate type. @@ -534,9 +537,9 @@ DJANGO_DD_COLOR_SCHEME = { 'types': { 'bool': <value>, # Booleans 'bound': <value>, # Django Bound Form Field - 'datetime': <value>, # DateTimes and similar types 'default': <value>, # Default color if does not fit into any of the others 'docs': <value>, # Class function documentation + 'intermediate': <value>, # The brief description output for "Intermediate" types 'module': <value>, # Module via ModuleType 'none': <value>, # None 'number': <value>, # Integers, Floats, and Decimals diff --git a/django_dump_die/static/django_dump_die/css/dd.css b/django_dump_die/static/django_dump_die/css/dd.css index d28e091..82c2e9c 100644 --- a/django_dump_die/static/django_dump_die/css/dd.css +++ b/django_dump_die/static/django_dump_die/css/dd.css @@ -120,7 +120,7 @@ a.arrow-toggle { .bound { color: #268bd2; } -.datetime { +.intermediate { color: #d33682; } .default { diff --git a/django_dump_die/templates/django_dump_die/output_types/complex_type.html b/django_dump_die/templates/django_dump_die/output_types/complex_type.html index f37a745..178b387 100644 --- a/django_dump_die/templates/django_dump_die/output_types/complex_type.html +++ b/django_dump_die/templates/django_dump_die/output_types/complex_type.html @@ -2,7 +2,7 @@ <span class="type" title="{{ type }}">{{ type }}{% if is_iterable %}:{{ object|length }}{% endif %}</span> {% if intermediate %} - <code class="datetime">{{ intermediate }}</code> + <code class="intermediate">{{ intermediate }}</code> {% endif %} <span class="braces">{{ braces.0 }}</span> diff --git a/django_dump_die/templates/django_dump_die/partials/_custom_color_theme.html b/django_dump_die/templates/django_dump_die/partials/_custom_color_theme.html index 90fdb19..523b918 100644 --- a/django_dump_die/templates/django_dump_die/partials/_custom_color_theme.html +++ b/django_dump_die/templates/django_dump_die/partials/_custom_color_theme.html @@ -227,9 +227,9 @@ color: {{ custom_color_theme.types.bound }}; } {% endif %} - {% if custom_color_theme.types.datetime %} - .datetime { - color: {{ custom_color_theme.types.datetime }}; + {% if custom_color_theme.types.intermediate %} + .intermediate { + color: {{ custom_color_theme.types.intermediate }}; } {% endif %} {% if custom_color_theme.types.empty %} diff --git a/django_dump_die/templatetags/dump_die.py b/django_dump_die/templatetags/dump_die.py index 48e8498..3be9af1 100644 --- a/django_dump_die/templatetags/dump_die.py +++ b/django_dump_die/templatetags/dump_die.py @@ -390,7 +390,7 @@ def _handle_simple_type(obj): elif isinstance(obj, (int, Decimal, float, bytes)): css_class = 'number' elif _is_intermediate_type(obj): - css_class = 'datetime' + css_class = 'intermediate' elif isinstance(obj, types.ModuleType): css_class = 'module' elif isinstance(obj, BoundField): diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index e4cb9a6..96381ce 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -95,10 +95,13 @@ times, these direct-child attributes are not further expandable. Predefined intermediate types include: +* bytesarray +* complex number * datetime * date * time * timezone +* pathlib paths If you would like to add additional intermediate types that are specific to your project, you can do that here. Be sure to list each type in the list as a @@ -397,9 +400,9 @@ Example:: 'types': { 'bool': <value>, # Booleans 'bound': <value>, # Django Bound Form Field - 'datetime': <value>, # DateTimes and similar types 'default': <value>, # Default color if does not fit into any of the others 'docs': <value>, # Class function documentation + 'intermediate': <value>, # The brief description output for "Intermediate" types 'module': <value>, # Module via ModuleType 'none': <value>, # None 'number': <value>, # Integers, Floats, and Decimals -- GitLab