Esempio n. 1
0
def getFullCatalog():
	catalog = []
	c = CatalogModel()
	categories = c.getCategories()
	for category in categories:
		category['topics'] = []
		topics = c.getTopicsByCategory(category['id'])
		for topic in topics:
			layers = c.getLayersByTopic(topic['id'])
			topic['layers'] = layers
			category['topics'].append(topic)
		catalog.append(category)

	result = {'result': catalog}

	return jsonify(result)