Open lvqier opened 5 years ago
because the check in model.get_parent
is just if found
but models
are instances of dictionaries... and a dictionary without elements is 'falsy'.
So A is not found because it is falsy. The get_parent method should really be something
like
def get_parent(self, name):
if self.name == name:
return self
else:
for parent in self.__parents__:
try:
return parent.get_parent(name)
except ValueError:
pass
raise ValueError("Parent " + name + " not found")
Parent is an empty dict:
Model has multiple parents