#NEWLINE# def generate_collection( addon , app = None ) : #NEWLINE# #INDENT# '\n    Generate a Collection, a CollectionAddon and a FeaturedCollection\n    for the given `addon` related to the optional `app`.\n\n    ' #NEWLINE# if ( app is None ) : #NEWLINE# #INDENT# application = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# application = app . id #NEWLINE# #UNINDENT# c = create_collection ( application = application ) #NEWLINE# generate_translations ( addon ) #NEWLINE# CollectionAddon . objects . create ( addon = addon , collection = c ) #NEWLINE# if ( app is not None ) : #NEWLINE# #INDENT# FeaturedCollection . objects . create ( application = application , collection = c )