Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to make morphodict compatible with django 4.2
There is one breaking change in the upgrade that impacts search and had to be tweaked. We use synthetic wordforms to add inflected entries that could or could not have definitions in the dictionary. This means that the entries may or may not exist. Previously, django silently accepted non-existing entries. This is no longer the case, and the search produces a value error as we can't find the wordform in the dictionary (when either serializing or prefetching related fields). Solution: Only prefetch and serialize if the element actually exists. We use the _state flags as discussed in https://docs.djangoproject.com/en/4.2/ref/models/instances/#django.db.models.Model._state TODO: Ensure that we actually search when a variant does have a definition. Add a test for this.
- Loading branch information