Many manipulation where made in the filter_queryset method dedicated to
the list view. We decided to create our own list method instead of using
the one provided by drf to make our own cook and filtering the viewset
only here instead in all actions.
We want to merge all the existings migrations. We don't want to maintain
migration with code related to django-treebeard and there is no need to
keep the migration between the two libraries.
At this point we are able to render folders and files, a basic breadcrumbs,
also a displayMode on the Explorer. Row selection works with simple click,
cmd click, shift click and also with region selection.
In the Item model we are calling the save method to update the object
itself in database. In that place we exactly know what is updated so we
can tell to the save method what are the fields to update using the
`update_fileds` parameter.
During refactor from django-treebeard to django-ltree we made a fork of
django-ltree in order to make a fix on it we need. This fix has been
merged into the initial project, we have to reuse it now.
The move feature was disabled when we refactor the code base to use the
ltree postgres extension. This feature has been fully implemented with
ltree now.
When the abilities are computes, each ancestors link_reach and link_role
are fetch. We can save several queries by saving them earlier in the
view and pass them to the model by adding them to the serializer
context.
We want to get a tree view for a given item. We want the tree from the
highest readable ancestor to the given tree and pick every siblings from
all the level crossed.
The number of children and the number of folder for a given item was
computed if not in cache. We decided to store it in database and
maintain it when an item is created or deleted.
Django has a native extension able to manage records in a hierchical way
combined with an index allowing to have high performance when querying
the database. The django_ltree lib is used, it adds some helper but is
really lightweight