The Django Model Path Converter package dynamically creates custom path converters for you models.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
docs
example
model_path_converter
tests
.editorconfig
.gitignore
.travis.yml
AUTHORS.rst
CONTRIBUTING.rst
HISTORY.rst
LICENSE
MANIFEST.in
Makefile
Pipfile
Pipfile.lock
README.rst
requirements_dev.txt
runtests.py
setup.cfg
setup.py
tox.ini

README.rst

Django Model Path Converter

Documentation Status

The Django Model Path Converter package dynamically creates custom path converters for you models.

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.