Skip to main content

match case support for django templates

Project description

Django Match case

the django-matchcase is a implementation for support match/case on django template language

Quick start

  1. Install django-matchcase app in INSTALLED_APPS
INSTALLED_APPS = [
    ...,
    "django_matchcase",
]
  1. load tags in your django templates
{% load match_case %}
<html>
    ...
</html>
  1. use the match/case tag
{% load match_case %}
...
<div>
    {% match user.rol %}
        {% case "admin" %}
            Welcom admin!!!
        {% case "superadmin" %}
            Hi, Spiderman
        {% default %}
            Hi, {{ user.username }}
    {% endmatch %}
</div>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_matchcase-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_matchcase-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file django_matchcase-0.1.0.tar.gz.

File metadata

  • Download URL: django_matchcase-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_matchcase-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5ab2594a702c94b0001b12fe2c0846e560e86f90249090a76b606924b3d8fa1a
MD5 c9251d675f4bdd3828a4345fb0e21717
BLAKE2b-256 2de1c69cfd8da52153e18a90ebd35e9c4de15bd3b1dd85604271991089b1cfaf

See more details on using hashes here.

File details

Details for the file django_matchcase-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: django_matchcase-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_matchcase-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a881dec9efc6afff37ab0f61dbd59981f6ee3ecfa73859e344c010a36c28a3e0
MD5 14ba93b62606d334dbe9a638eb52b535
BLAKE2b-256 1ea79d8f6f81cf5826d1519fc97d60d53d131a4f42f9ad28abf9f9809306e3c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page