def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def create_class(length):
            class S(Structure):
                _fields_ = [('x' * length, c_int)]