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 hashes)

Uploaded Source

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