def _collection_to_search_dict(collection):
 rights = rights_manager.get_collection_rights(collection.id)
 doc = {'id': collection.id, 'title': collection.title, 'category': collection.category, 'objective': collection.objective, 'language_code': collection.language_code, 'tags': collection.tags, 'rank': _get_search_rank(collection.id)}
 doc.update(_collection_rights_to_search_dict(rights))
 return doc

def _collection_to_search_dict ( collection ) : rights = rights_manager . get_collection_rights ( collection . id ) doc = { 'id' : collection . id , 'title' : collection . title , 'category' : collection . category , 'objective' : collection . objective , 'language_code' : collection . language_code , 'tags' : collection . tags , 'rank' : _get_search_rank ( collection . id ) } doc . update ( _collection_rights_to_search_dict ( rights ) ) return doc
converts a collection domain object to a search dict .