def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def setTail(self, pt):
        self.pt = pt
        self.Tail.Eq(pt)
        self.Head.setPoint(self.pt.x + self.x, self.pt.y + self.y)