Skip to main content

Taking the O out of ORM.

Project description

About django-model-values

Provides Django model utilities for encouraging direct data access instead of unnecessary object overhead. Implemented through compatible method and operator extensions QuerySets and Managers.

The goal is to provide elegant syntactic support for best practices in using Django’s ORM. Specifically avoiding the inefficiencies and race conditions associated with always using objects.

Usage

Do you want readability, …

book = Book.objects.get(pk=pk)
book.rating = 5.0
book.save()

efficiency, correctness, …

Book.objects.filter(pk=pk).update(rating=5.0)

Choose all 3

Book.objects[pk]['rating'] = 5.0

Instantiate the custom Manager in your models. See documentation for more examples.

Installation

Standard installation from pypi or local download.

$ pip install django-model-values
$ python setup.py install

Dependencies

  • Django

  • Python 2.7, 3.2+

Tests

100% branch coverage. Tested against Django 1.8 and Python 2.7, 3.4.

$ py.test

Project details


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-values-0.1.tar.gz (14.0 kB view details)

Uploaded Source

File details

Details for the file django-model-values-0.1.tar.gz.

File metadata

File hashes

Hashes for django-model-values-0.1.tar.gz
Algorithm Hash digest
SHA256 5c91e6e763a22e0babdccde55ee0671fb1b555498249fb149dfbc154fb44ebb9
MD5 d65c89f20295297ccd747a763ca10a98
BLAKE2b-256 05ff2cd79a2b5b104b8bd1835b8da3533ca18808ea8c128c0685795576fe3a62

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