5 Django packages that extend the functionality of models or add new classes of models

Conditional aggregates for Django queries, just like the famous SumIf and CountIf in Excel.

Imagine you have a model Offer like this one:

class Offer(models.Model):
    sponsor = models.ForeignKey(User)
    price = models.DecimalField(max_digits=9, decimal_places=2)
    status = models.CharField(max_length=30)
    expire_at = models.DateField(null=True, blank=True)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    OPEN = "OPEN"
    PAID = "PAID"



Django-localflavor - Python


Country-specific Django helpers, formerly of contrib fame



Django-model-utils - Python


Django model mixins and utilities.


Utilities for implementing a modified pre-order traversal tree in django.


Efficient tree implementations for Django


  • Flexible: Includes 3 different tree implementations with the same API:
    1. Adjacency List
    2. Materialized Path
    3. Nested Sets
  • Fast: Optimized non-naive tree operations
  • Easy: Uses Django Model Inheritance with abstract classes to define your own models.
  • Clean: Testable and well tested code base. Code/branch test coverage is above 96%. Test suite running on different versions of Python and Django: https://travis-ci.org/django-treebeard/django-treebeard/
django python tree-structure