def lastModifiedTimeMs(self): """ Returns the last modified time of this Blip in milliseconds since the epoc. """ return datetime2milliseconds(self.last_modified)
def timestampMs(self): """ Returns the timestamp of this Delta in milliseconds since the epoc. """ return datetime2milliseconds(self.timestamp)
def creationTimeMs(self): """ Returns the time of creation of this Blip in milliseconds since the epoc. """ return datetime2milliseconds(self.created)
def serialize(self): """ Serialize the wavelet into a format that is compatible with robots and the client. """ return { "rootBlipId": getattr(self.root_blip, "id", None), "title": self.title, "creator": self.creator.id, "creationTime": datetime2milliseconds(self.created), "dataDocuments": None, #TODO (is not declared in the robot protocol example) "waveletId": self.id, "participants": map(lambda p: p.id, self.participants.all()), "version": self.version, "lastModifiedTime": datetime2milliseconds(self.last_modified), "waveId": self.wave.id, }
def serialize(self): """ Serialize the blip into a format that is compatible with robots and the client. """ return { "blipId": self.id, "content": self.text, "elements": map(lambda e: e.serialize(), self.elements.all()), "contributors": map(lambda p: p.id, self.contributors.all()), "creator": self.creator.id, "parentBlipId": getattr(self.parent, "id", None), "annotations": map(lambda a: a.serialize(), self.annotations.all()), "waveletId": self.wavelet.id, "version": self.version, "lastModifiedTime": datetime2milliseconds(self.last_modified), "childBlipIds": map(lambda c: c.id, self.children.all()), "waveId": self.wavelet.wave.id, "submitted": bool(self.submitted), "checksum": self.checksum() # Note: This is tentative and subject to change }