本文整理匯總了Python中leancloud.Object方法的典型用法代碼示例。如果您正苦於以下問題:Python leancloud.Object方法的具體用法?Python leancloud.Object怎麽用?Python leancloud.Object使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類leancloud
的用法示例。
在下文中一共展示了leancloud.Object方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: init_app
# 需要導入模塊: import leancloud [as 別名]
# 或者: from leancloud import Object [as 別名]
def init_app(app):
app.config.update({'SECRET_KEY': const.SECRET_KEY})
login_manager = LoginManager(app)
login_manager.session_protection = 'basic'
login_manager.login_view = 'auth.xauth'
login_manager.refresh_view = 'auth.xauth'
class FFAuth(Object):
pass
@login_manager.user_loader
def load_user(user_id):
try:
return FFAuth.query.get(user_id)
except LeanCloudError as _:
pass
return None
app.register_blueprint(main_view)
app.register_blueprint(auth_view)
示例2: save
# 需要導入模塊: import leancloud [as 別名]
# 或者: from leancloud import Object [as 別名]
def save(value):
Email = leancloud.Object.extend('Email')
email = Email()
email.set('src', value)
is_exist = False
try:
query = Query(Email)
if query.equal_to('src', value=value).first() is not None:
print '?????? %s ??' % value
except Exception as e:
# ??????
print e
email.save()
is_exist = True
pass
return is_exist
示例3: __init__
# 需要導入模塊: import leancloud [as 別名]
# 或者: from leancloud import Object [as 別名]
def __init__(self, owner=None, file_name=None, file=None, name=None):
leancloud.Object.__init__(self)
self.owner = owner
self.file_name = file_name
self.file = file
self.name = name