def as_tuple(self):
    parent = self.parent
    return ((self.id, (parent and parent.as_tuple())), None)
def as_tuple(self):
    parent = self.parent
    return ((self.id, (parent and parent.as_tuple())), None)