Пример #1
0
 def create_new(cls, email, password):
     user = User.load(email)
     if user:
         return user
     else:
         new_user_id = db_conn.incr(USER_INDEX_ID)
         new_user = cls(email=email, password=password, id=new_user_id, create_new=True)
         new_user.save()
         db_conn.set("kitten:user_by_id:%i" % new_user_id, new_user.email)
         return new_user
Пример #2
0
 def save(self):
     search_request = {'user': self.user, 'need': self.need, 'id': self.id}
     db_conn.set(self.key, json.dumps(search_request))
Пример #3
0
 def save(self):
     serialized = {'email': self.email, 'password': self.password, 'id': self.id}
     db_conn.set(self.user_key, json.dumps(serialized))