by Miguel Sanda
As the maintainer of Django Ledger, an open-source Django application designed to simplify financial accounting workflows, I am pleased to announce the release of version 0.8.0. This update introduces significant refactoring for entity handling, modern dependency alignments, and refinements to user experience, positioning the project for greater scalability and maintainability.
This release includes breaking changes, reflected in the version increment to 0.8.0. To support a smooth transition, deprecation warnings and a configurable backward-compatibility option have been implemented.
At the heart of v0.8.0 is a comprehensive refactor of entity referencing, with a particular emphasis on the for_entity methods in querysets and models. Previously, these methods relied on fragmented parameters like entity_slug and user_model, which could lead to inconsistent filtering and unnecessary complexity in financial queries. To address this, we've unified the approach around the more robust entity_model parameter, which now seamlessly accepts:
This refactor has been applied across multiple models, querysets, and views, fundamentally improving how entity-specific data is filtered and retrieved. For instance, querysets now leverage entity_model for optimized filtering, enabling more efficient operations in entity-scoped workflows—such as generating reports for a specific business unit or client in a Wagtail-powered financial dashboard.
Key enhancements include:
For existing projects, the DJANGO_LEDGER_USE_DEPRECATED_BEHAVIOR setting in settings.py provides a migration lifeline:
When enabled, it reactivates deprecated behaviors temporarily, giving developers time to update their querysets and views. A dedicated utility module further aids in managing these transitions, ensuring that even complex Wagtail integrations—where entity querysets power dynamic financial pages—can upgrade without halting production.
This refactor not only clarifies the API but also paves the way for future extensions, such as advanced entity hierarchies in accounting models. If you're scripting entity-based queries in Wagtail, expect noticeable gains in readability and speed.
Refinements to core models include:
Migration 0025 has been restored to apply these changes without data disruption. Templates have been adjusted to conditionally render address fields, and status icons (active/hidden) now feature standardized styling.
The ChartOfAccounts model has been fortified with:
These features support lazy hierarchy creation for root and child accounts, reducing setup overhead in scripted environments like Wagtail.
Template rendering now supports theme selection via the DJANGO_LEDGER_THEME setting (default: lux), with validation for lux and minty options. A new django_ledger_context processor injects variables such as DEBUG, VERSION, and theme data into templates, requiring addition to the TEMPLATES configuration in settings.py.
Settings imports have been standardized to django.conf.global_settings, with cleanup of obsolete configurations.
Usability improvements to financial reports include:
Data import forms have also received usability updates for efficient bulk operations.
Thank you for your continued support of Django Ledger.