Skip to main content

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

Project description

Django Model Path Converter

https://img.shields.io/pypi/v/django-model-path-converter.svg https://img.shields.io/travis/dhepper/django-model-path-converter.svg 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.

History

0.1.0 (2018-05-11)

  • First release on PyPI.

Project details


Download files

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

Files for django-model-path-converter, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size django_model_path_converter-0.1.0-py2.py3-none-any.whl (3.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-model-path-converter-0.1.0.tar.gz (15.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page