def load_tree_from_db(self) -> AssetAllocationModel:
self.model = AssetAllocationModel()<EOL>self.model.currency = self.__get_config().get(ConfigKeys.default_currency)<EOL>db = self.__get_session()<EOL>first_level = (<EOL>db.query(dal.AssetClass)<EOL>.filter(dal.AssetClass.parentid == None)<EOL>.order_by(dal.AssetClass.sortorder)<EOL>.all()<EOL>)<EOL>for entity in first_level:<EOL><INDENT>ac = self.__map_entity(entity)<EOL>self.model.classes.append(ac)<EOL>self.model.asset_classes.append(ac)<EOL>self.__load_child_classes(ac)<EOL><DEDENT>return self.model<EOL>
Reads the asset allocation data only, and constructs the AA tree