I know this is copied from one of the existing factories, but there's an (unmerged) example of how to do this  todo here: https://github.com/ckan/ckan/pull/1349/files#diff-43c9a037836368d984b5f30588c9f85fR310 I don't know why the group factory get merged with a TODO in it, should not have been imho