Django-hordak

Latest version: v1.17.0

Safety actively analyzes 701427 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

2.0.0a3

====================

- Nothing changed yet.

2.0.0a2

====================

* Added a relation between the `LegView` model and the `Leg` model. This makes traversing models from
`LegView` possible.

2.0.0a1

====================

.. note::

**Upgrade to Hordak 1.17 before upgrading to 2.0**

Hordak 1.17 will issue deprecation warnings for most issues you may encounter in the
2.0 upgrade. Fix those warnings and your upgrade should be smooth.

* **Breaking**: ``transfer_to()`` was deprecated in 1.16. This old implementation has now been removed
and the newer ``transfer_to_accounting()`` has been renamed to take its place.
Existing uses of ``transfer_to_accounting()`` should be updated to
point to ``transfer_to()``. This change standardises the behaviour of this method on industry norms.
* **Breaking**: ``Leg.account_balance_after()`` and ``Leg.account_balance_before()`` have been removed and replaced
with annotations which populate properties of the same name. Enable this annotations using
``Leg.objects.with_account_balance_after()`` and ``Leg.objects.with_account_balance_before()``
* **Breaking**: New account currencies now default to ``DEFAULT_CURRENCY`` rather than all available currencies
(trading accounts should be the only accounts with multiple currencies).
* **Breaking**: Removed ``django-smalluuid``. UUIDs in URLs will now be rendered in the regular UUID format.
* **Breaking**: Balance methods have be renamed to make way for (more performant) annotated properties.
Deprecation notices are issued by Hordak 1.17:

* ``Account.balance()`` -> ``Account.get_balance()``
* ``Account.simple_balance()`` -> ``Account.get_simple_balance()``
* ``Transaction.balance()`` -> ``Transaction.get_balance()``

* **Feature:** New accounting-oriented database view on the Legs table (keep your accountants happier). Adds columns

* ``debit`` - the debit amount, always positive, or null if the leg is a credit
* ``credit`` - the credit amount, always positive, or null if the leg is a debit
* ``amount`` - the amount, always positive
* ``type`` - DR or CR
* ``account_balance`` – The account balance following the leg (only available for leaf accounts)
* ``account_id``, ``account_name``, ``account_full_code``, ``account_type``

* **Feature:** New accounting-oriented database view on the Transactions table

* Shows the transaction amount (JSON list, one value per currency)
* Shows credited/debited account IDs & names

* **Feature:** Added ``GET_BALANCE(account_id: BIGINT, as_of: DATE = NULL, as_of_leg_id: INT = NULL)`` database function. Will get the balance of an account.
* **Feature**: Many balance calculations are now available as query annotations, and are performed in-database. This represents a
significant performance improvement. See the ``AccountQueryset`` and ``LegQueryset``.
* **Enhancement:** Account code max length increased from 3 to 6
* ``Balance.__eq__()`` now returns False rather than raising an exception if the other object is not a ``Balance``
* Removed used of ``django-sql-utils``
* Removed use of ``django-model-utils``. Model choices have the same values, but the data
structures have changed to use the Django-native ``models.TextChoices``. The old syntax will continue to work until Hordak 3.0:

* ``Account.TYPES`` is now ``AccountType``
* ``TransactionCsvImportColumn.TO_FIELDS`` is now ``ToField``
* ``TransactionCsvImport.STATES`` is now ``TransactionCsvImportState``

1.17.0

===========================

* Deprecated Account.balance(), now renamed to Account.get_balance().
The `balance` property can be pre-populated in Hordak 2.0 using `Account.objects.with_balances()`.
* Deprecated Transaction.balance(), now renamed to Transaction.get_balance().

1.16.0

=================================

* Now testing against Django 5.1
* Account code regeneration major performance improvement in database trigger (117)
* Improvements to ratio_split()

* Adding assertion to catch div-by-zero error
* Adding assertion failure messages
* Adding ``precision`` parameter (defaults to previous value)

* Adding ``get_next_account_code()`` utility function (114)
* ``currency_exchange()`` can now charge fees in the destination currency (56)
* Fixed error in ``Balance`` comparison where one value is a zero-balance and the other is a zero-decimal
* Fixed search in admin UI, was giving a 500 error (107)
* Add ``__str__()`` method to Leg model
* Postgres migrations can now reverse all the way back to zero

1.15.0

===============================
* updated testing to Django 5.0, Python 3.12
* fixed Resource to be compatible with django-import-export 3.3.5-4.0.0b2
* dropped support of Django < 4.2, Python < 3.8

Page 1 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.