Skip to main content

================== 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.

Metadata

Release files for django-model-ident 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-model-ident 0.2
File Size Uploaded
django-model-ident-0.2.tar.gz 2.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-model-ident 0.2
File Interpreter ABI Platform
django_model_ident-0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 6.7 kB

Release files / django-model-ident-0.2.tar.gz

Download URL django-model-ident-0.2.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8c3e5cc363b471382b28c90fce39db47f4cd9e115ad14c7d00895f8ed1807e6f
BLAKE2b-256 checksum
How to use checksums
ccb7179585bf8b87e349ffb0fbd8553479953454459124ad02fb359a34f33868
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / django_model_ident-0.2-py2.py3-none-any.whl

Download URL django_model_ident-0.2-py2.py3-none-any.whl
Size 4.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a78ebc3d4ac8f3e0dfc03db0513bb75fa3a883d15a2dbf87d47eb2466edd88df
BLAKE2b-256 checksum
How to use checksums
136c8f1450e23f70bd7bb3ffcad8e2ebc37d3588a30ee0c87b3aeb4111eb4194
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page