def setUserprop(self, key, value):
"""
Set single user's property. User's property must have key and value
return True if all done
return False if something wrong
"""
value = pickle.dumps(value)
instance = self.session.query(Userprop).filter_by(key=key).first()
if instance:
instance.value = value
else:
instance = Userprop(key, value)
self.session.add(instance)
self.session.commit()
return True
评论列表
文章目录