docs: def get_subcols(module_ident, plpy):
      """Get all the sub-collections that the module is part of."""
      plan = plpy.prepare('''
      WITH RECURSIVE t(node, parent, path, document) AS (
          SELECT tr.nodeid, tr.parent_id, ARRAY[tr.nodeid], tr.documentid
          FROM trees tr
          WHERE tr.documentid = $1 and tr.is_collated = 'False'
      UNION ALL
          SELECT c.nodeid, c.parent_id, path || ARRAY[c.nodeid], c.documentid
          FROM trees c JOIN t ON (c.nodeid = t.parent)
          WHERE not c.nodeid = ANY(t.path)
      )
      SELECT DISTINCT m.module_ident
      FROM t JOIN modules m ON (t.document = m.module_ident)
      WHERE m.portal_type  = 'SubCollection'
      ORDER BY m.module_ident
      ''', ('integer',))
      for i in plpy.execute(plan, (module_ident,)):
          yield i['module_ident']