The Django Model Path Converter package dynamically creates custom path converters for you models.
Project description
Django Model Path Converter
The Django Model Path Converter package dynamically creates custom path converters for you models.
Free software: MIT license
Documentation: https://django-model-path-converter.readthedocs.io.
Background story: https://consideratecode.com/django-model-path-converters
Quickstart
Install the latest version:
pip install django-model-path-converter
Import register_model_converter and your model in your urls.py:
from model_path_converter import register_model_converter from .models import MyModel
Register a converter for your model:
register_model_converter(MyModel)
Use the new converter in your path definitions:
path('<my_model:obj>/', views.my_view, name='my-view')
Your view my_view will now receive a MyModel instance as argument.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2018-05-11)
First release on PyPI.
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
Hashes for django-model-path-converter-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12b1114bc266feb03bac25fbb3a85fbecf7c5c64a3d5747db92021e401f9f6e8 |
|
MD5 | 120af15baf8abe6fc39ba813561f0dd2 |
|
BLAKE2b-256 | 3c3cc5ed457c1497ba965aca225563f48b2d9533aa152973c0e0be15138a4c6e |
Hashes for django_model_path_converter-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f3592599905fd5f01340152c8547f191173715cb2cf5f31b165112f4a0d13b6 |
|
MD5 | 813081a51a06a369f485412d350a816a |
|
BLAKE2b-256 | 316cd8dec74e71e85a2f2c871168f0720a555b5ff5c61c0b8b5d2e5a0306a052 |