Skip to content

Bump to Django 3.1

Erwan Rouchet requested to merge django-3 into master

Part of architecture#14. When merging, please create a base-django-3.1 tag!

  • Django REST Framework does support Django 3.1 via 3.11.1, a quick release that fixed some broken imports. However, the ModelSerializer is unable to translate the new JSONField into a JSON serializer field by itself. This adds one line to the WorkerVersion serializer. https://github.com/encode/django-rest-framework/pull/7467
  • Starting with Django 3.0, applying prefetch_related on a union() of two QuerySets is not allowed; however, we can apply the prefetch_related to both querysets in the union without any loss in query optimisation. This changes EntityElements.get_queryset
  • Starting with Django 3.1, Meta.ordering no longer affects queries that have a GROUP BY. This causes the CorpusMLClassList endpoint to loose its implicit class name ordering, which has been explicitly restored in its queryset.
  • An optimization in DELETE queries having Q objects combined with OR causes one less query in the ML results deletion consumer.
  • Cookie SameSite settings now have two separate options 'None' (string) and False (boolean)
  • django-cors-headers needed to be upgraded to support Django 3, and this caused a breaking change to be pulled on the origin whitelist, causing protocol schemes to be required (architecture!116)
  • Django 3 added some complexity to the way it handles iterables as query filters, causing errors on the Point constructor. Support for Point(iterable) is added alongside Point(int, int).
  • One failing test due to common!63; fixed in !867 (merged)
Edited by Erwan Rouchet

Merge request reports

Loading