There's a small docstring mismatch here that existed even in the code before. to_plugin_associated_unit says the type def will be the ContentType object from the domain model. all_type_definitions returns straight from the DB, meaning it's just a dict (in fact, that signature is correct).

While you're in here, can you update the docstring for to_plugin_associated_unit to correct the :type: for type_def? A cookie if you convert them to reST instead of epydocs at the same time  :cookie: