def _default(self, data): try: return util.b64e(data.binary) except AttributeError: pass try: return int(mktime(data.timetuple())) except AttributeError: pass return str(data)
def _new(self, email): self.email = email self.shortcut = b64e(uuid4().bytes)
def _new(self): self.id = b64e(uuid4().bytes) self.expires = datetime.utcnow() + config.session_ttl
def _pack(self, value): return util.b64e(value.binary)
def _dump(self, attr): return util.b64e(attr.binary)