Exemple #1
0
 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)
Exemple #2
0
 def _new(self, email):
     self.email = email
     self.shortcut = b64e(uuid4().bytes)
Exemple #3
0
 def _new(self):
     self.id = b64e(uuid4().bytes)
     self.expires = datetime.utcnow() + config.session_ttl
Exemple #4
0
 def _pack(self, value):
     return util.b64e(value.binary)
Exemple #5
0
 def _dump(self, attr):
     return util.b64e(attr.binary)