Great Progress at the Plone Relations Sprint

The sprint, held in January 2021, resulted in improvements to Plone's relations machinery that will be polished and finished in a sequel sprint to be held February 27th

At the 2020 Plone Conference, Philip Bauer gave a Day 3 lightning talk titled "Why Relations are Weird" (at minute 12:13 of the video). In the talk he explained how Plone relations code is not straightforward to work with, and he described a package he wrote to help: collective.relationhelpers. Inspired by lots of buzz on the conference Slack channel afterwards - including a number of calls to "put that relation helper into plone.api!" - a group including Philip, Alec Mitchell, David Glick, Jans Klein, and Alec Ghica held a conference Open Space to discuss possible changes to how Plone relations work. Ideas for major improvements (though appealing) were dismissed as simply too much work, but all agreed that the following changes were both desirable and feasible to accomplish in a short sprint.

  • Move calls from collective.relationhelpers to the Plone API.
  • Add most of the other collective.relationhelpers code (including rebuild_relations) into CMFPlone.
  • Fix the data managers for relation fields to make it easier to use other kinds of widgets with them.

A remote sprint to work on these changes took place on January 30th and 31st and was attended by Philip Bauer, Alec Mitchell, Fred van Dijk, Maurits van Rees, Iulian Petchesi, Alexander Loechal and Sally Kleinfeldt. All agreed to put this improvement in core and to put documentation in We also agreed to only work on Plone API and save the RestAPI work for others who know it better.

  • Philip, Alec and Fred worked on data managers and converters, better widgets for relation fields, and an easy way to define a catalog query in the schema for any type of select widget.
  • Maurits and Iulian worked on additions to plone.api, including relation create, delete, and get methods and tests for them.
  • Alexander worked on the tox setup to make testing Plone API easier, and on control panels for Plone relations - one to inspect and one to rebuild.

By the end of the sprint nothing was finished (i.e. merged and released), but a lot was accomplished and the code produced is production quality. A follow on sprint was scheduled to polish off loose ends (plone.api methods, control panel for Plone Classic and Volto, documentation, tests) and review and merge PRs.

Everyone at the sprint was excited to have made a significant improvement to a gnarly part of Plone core code.