This document highlights steps that may need to be taken by developers when upgrading OMERO.web to ensure plugins or other customizations continue to function as expected.
To prepare for upcoming Django upgrades, this upgrade changes how Connector objects are stored to a "persist and rehydration" strategy similar to how the Django authentication middleware handles model objects.
Any downstream implementation which was directly assigning and/or retrieving
request.session["connector"]
will need to update their codebase:
- all usages of
request.session.get("connector")
should be replaced byConnector.from_session(request)
- all usages of
request.session["connector"] = connector
should be replaced byconnector.to_session(request)
More information at ome#435
If your plugin or customizations depend on any of the following libraries, please make sure to check for breaking API or CSS changes.
Library | Previous Version | Upgraded to | Link |
---|---|---|---|
d3 | 3.5.17 | 7.7.0 | https://d3js.org/ |
hammer | 2.0.2 | 2.0.8 | https://hammerjs.github.io/ |
jquery | 3.5.1 | 3.6.2 | https://jquery.com/download/ |
jquery-ui | 1.12.1 | 1.13.2 | https://jqueryui.com/download/ |
jquery.jstree | 3.3.10 | 3.3.12 | https://www.jstree.com/ |
jquery.mousewheel | 3.0.6 | 3.1.12 | |
raphael | 2.1.0 | 2.3.0 | https://dmitrybaranovskiy.github.io/raphael/ |
underscore | 1.13.1 | 1.13.6 | https://underscorejs.org/ |
More information at ome#433
Django 3.2.x is now the major version that OMERO.web depends upon. For system administrators, the installation of omero-web==5.14.0
will also upgrade Django and Django-cors-headers as required.
You will also need to upgrade your omero-web
plugin apps to versions compatible with Django 3.2.
Popular apps such as omero-iviewer
, omero-figure
, omero-parade
, omero-mapr
and omero-webtagging
have been updated accordingly.
You many need to uninstall other Django apps such as https://pypi.org/project/django-cookies-samesite/ which is not needed for Django 3.1+
.
The remainder of this guide is for omero-web
plugin developers.
All the way back to 5.6.0, this was previously Django 1.11.x. This Django version conservatism has helped us establish a very fertile, stable environment for plugin developers. However, while the usage of the plethora of Django functionality available in core OMERO.web is quite limited, upgrading your plugin to support this new version requires careful consideration.
All plugin developers are encouraged to review the release notes, in particular the Backwards incompatible and Features deprecated for all major Django versions since 1.11.x to ensure they can be compliant with the new APIs. They are as follows:
- https://docs.djangoproject.com/en/4.0/releases/2.0/
- https://docs.djangoproject.com/en/4.0/releases/2.1/
- https://docs.djangoproject.com/en/4.0/releases/2.2/
- https://docs.djangoproject.com/en/4.0/releases/3.0/
- https://docs.djangoproject.com/en/4.0/releases/3.1/
- https://docs.djangoproject.com/en/4.0/releases/3.2/
django.core.urlresolvers
package (deprecated since 1.10) has been replaced withdjango.urls
- Removal of case insensitive URL matching (deprecated since 1.11)
- Refactor use of QuerySet semantics in
ModelChoiceField
subclasses
django.contrib.staticfiles.templatetags
package (deprecated since 2.1) has been replaced withdjango.templatetags.static
- Update to the new field ordering style for forms
- Update to the new internal settings cleansing API
- Use the new package (
django.core.validators
) for empty value definitions
There is only one major backwards incompatible change affecting OMERO.web 5.14.0 and that is the removal of support for case insensitive URL matching. You can recognize your use of this feature by examining your urls.py
packages for the use of (?i)
in your matching regular expressions. If your plugin makes use of case insensitivity in URL matching, which has been deprecated since Django 1.11, we recommend that you first consider if you really need this feature. If you do you can consult the Django 1.11 release notes for some suggested solutions on mitigation.
Apart from the aforementioned major issue, the vast majority of plugin developers will be able to remain compatible with pre and post 5.14.0 OMERO.web just by switching their use of the django.core.urlresolvers
package to django.urls
. This new package was present in Django 1.11.
If you are making subclasses of the OMERO.web form ModelChoiceField
subclasses or making subclasses of your own you will likely not be able to remain backwards compatible. The same goes for if you have subclassed any OMERO.web Django forms or have created any of our own. This is especially true if you are relying on a specific form field ordering.
Finally, some of the internal Django APIs have changed substantially either in semantics or in package location. You will not likely be able to remain backwards compatible if you rely on these APIs.
- from django.core.urlresolvers import reverse
+ from django.urls import reverse
- url(r"^(?i)webgateway/", include("omeroweb.webgateway.urls")),
+ url(r"^webgateway/", include("omeroweb.webgateway.urls")),
- from django.contrib.staticfiles.templatetags.staticfiles import static
+ from django.templatetags.static import static
- self.fields.keyOrder = ["server", "username", "password"]
+ self.field_order = ["server", "username", "password"]
- from django.forms.fields import ChoiceField, EMPTY_VALUES
+ from django.forms.fields import ChoiceField
- from django.core.validators import validate_email
+ from django.core.validators import validate_email, EMPTY_VALUES