def generate_collection(addon, app=None):
 if (app is None):
  application = None
 else:
  application = app.id
 c = create_collection(application=application)
 generate_translations(c)
 CollectionAddon.objects.create(addon=addon, collection=c)
 if (app is not None):
  FeaturedCollection.objects.create(application=application, collection=c)

def generate_collection ( addon , app = None ) : if ( app is None ) : application = None else : application = app . id c = create_collection ( application = application ) generate_translations ( c ) CollectionAddon . objects . create ( addon = addon , collection = c ) if ( app is not None ) : FeaturedCollection . objects . create ( application = application , collection = c )
generate a collection .