Django Utils is a collection of small Django helper functions and classes which make common patterns shorter and easier.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
django_utils
docs added recursive field Feb 15, 2017
tests added django 1.11 and django 2.0 compatibility Apr 5, 2018
.coveragerc added support for python 3, pypy, pypy3 and updated the documentation Nov 23, 2014
.gitignore fixed requirements for travis Feb 9, 2014
.travis.yml
README.rst
pytest.ini
setup.cfg added bdist wheel support Dec 11, 2016
setup.py attempting to fix docs tests in travis Apr 5, 2018
tox.ini

README.rst

Introduction

Travis status:

https://travis-ci.org/WoLpH/django-utils.png?branch=master

Coverage:

https://coveralls.io/repos/WoLpH/django-utils/badge.png?branch=master

Django Utils is a collection of small Django helper functions, utilities and classes which make common patterns shorter and easier. It is by no means a complete collection but it has served me quite a bit in the past and I will keep extending it.

Examples are:

  • Enum based choicefields
  • Models with automatic __str__, __unicode__ and __repr__ functions based on names and/or slugs using simple mixins.
  • Models with automatic updated_at and created_at fields
  • Models with automatic slugs based on the name property.
  • Iterating through querysets in predefined chunks to prevent out of memory errors

The library depends on the Python Utils library.

Documentation is available at: http://django-utils-2.readthedocs.io/en/latest/

Install

To install:

  1. Run pip install django-utils2 or execute python setup.py install in the source directory
  2. Add django_utils to your INSTALLED_APPS

If you want to run the tests, run py.test (requirements in tests/requirements.txt)

Links