def datasetsListIntoTree(dList):
	"""Transforms list of datasets into a neested dict where keys are year and quartal"""
	d = {}
	for rec in dList:
		if rec.quartal:
			if rec.year not in d:
				d[rec.year] = [None] * 4
			d[rec.year][rec.quartal - 1] = rec
		else:
			d[rec.year] = rec
	return d