Skip to main content

Django app to provide classes quick pk only lookups

Project description

================== django-model-ident

.. image:: https://badge.fury.io/py/django-model-ident.png :target: https://badge.fury.io/py/django-model-ident

.. image:: https://travis-ci.org/ckirby/django-model-ident.png?branch=master :target: https://travis-ci.org/ckirby/django-model-ident

.. image:: https://coveralls.io/repos/ckirby/django-model-ident/badge.png?branch=master :target: https://coveralls.io/r/ckirby/django-model-ident?branch=master

django-model-ident provides a quick lookup for django models by pk only. Instead of writing ModelName.objects.get(pk=pk) write ModelName.ident_(pk)

Project

The project can be found at https://github.com/ckirby/django-model-ident

Requirements

  • Django 1.11+
  • Python 3.4+

Usage

Add 'model-ident' to your INSTALLED_APPS

How Does It Work

ON ready() django-model-ident monkey patches all the models found in your INSTALLED_APPS with the method ident_(pk). This calls ._base_manager.get(pk=pk). We use _base_manager so as not to get confused by changes in ModelManagers.

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

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

Source Distribution

django-model-ident-0.2.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

django_model_ident-0.2-py2.py3-none-any.whl (4.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-model-ident-0.2.tar.gz.

File metadata

  • Download URL: django-model-ident-0.2.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.4.2

File hashes

Hashes for django-model-ident-0.2.tar.gz
Algorithm Hash digest
SHA256 8c3e5cc363b471382b28c90fce39db47f4cd9e115ad14c7d00895f8ed1807e6f
MD5 1f3479a848bcff8658168207e174b6fd
BLAKE2b-256 ccb7179585bf8b87e349ffb0fbd8553479953454459124ad02fb359a34f33868

See more details on using hashes here.

File details

Details for the file django_model_ident-0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: django_model_ident-0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.4.2

File hashes

Hashes for django_model_ident-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a78ebc3d4ac8f3e0dfc03db0513bb75fa3a883d15a2dbf87d47eb2466edd88df
MD5 ec57d292231c78a60eb69497c54651c9
BLAKE2b-256 136c8f1450e23f70bd7bb3ffcad8e2ebc37d3588a30ee0c87b3aeb4111eb4194

See more details on using hashes here.

Supported by

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