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
- Install django-matchcase app in INSTALLED_APPS
INSTALLED_APPS = [
...,
"django_matchcase",
]
- load tags in your django templates
{% load match_case %}
<html>
...
</html>
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ab2594a702c94b0001b12fe2c0846e560e86f90249090a76b606924b3d8fa1a
|
|
| MD5 |
c9251d675f4bdd3828a4345fb0e21717
|
|
| BLAKE2b-256 |
2de1c69cfd8da52153e18a90ebd35e9c4de15bd3b1dd85604271991089b1cfaf
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a881dec9efc6afff37ab0f61dbd59981f6ee3ecfa73859e344c010a36c28a3e0
|
|
| MD5 |
14ba93b62606d334dbe9a638eb52b535
|
|
| BLAKE2b-256 |
1ea79d8f6f81cf5826d1519fc97d60d53d131a4f42f9ad28abf9f9809306e3c1
|