1. Lars Yencken
  2. django-hierarchy
  3. Issues
Issue #5 new

Perfect object state through weakrefs

Lars Yencken
repo owner created an issue

When you perform a tree operation, that may invalidate the position data held in existing in-memory Django ORM tree nodes.

We currently require the user to ensure that consistency is kept, either through careful sequencing of operations or calls to {{{refresh_position()}}}. This is potentially cumbersome through.

We could instead maintain a per-model list of these nodes using weakrefs, and update them in-memory for basic tree operations. In this way, the in-memory nodes would always be consistent.

Comments (0)

  1. Log in to comment