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
def save(self): search_request = {'user': self.user, 'need': self.need, 'id': self.id} db_conn.set(self.key, json.dumps(search_request))
def save(self): serialized = {'email': self.email, 'password': self.password, 'id': self.id} db_conn.set(self.user_key, json.dumps(serialized))