本文整理汇总了Python中account.models.Account.put方法的典型用法代码示例。如果您正苦于以下问题:Python Account.put方法的具体用法?Python Account.put怎么用?Python Account.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类account.models.Account
的用法示例。
在下文中一共展示了Account.put方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: account
# 需要导入模块: from account.models import Account [as 别名]
# 或者: from account.models.Account import put [as 别名]
def account(request):
# Get an account object
account = request.account
if not account:
account = Account(user=request.user)
account.put()
# Setup the form
initial = {
"photo_backend": account.photo_backend,
"site_title": account.site_title,
"site_header": account.site_header,
"thumb_size": account.thumb_size,
"thumb_cropped": account.thumb_cropped,
"full_size": account.full_size,
"homepage_size": account.homepage_size,
"homepage_album": account.homepage_album,
"featured_albums": account.featured_albums,
"service_username": account.service_username,
"merchant_id": account.merchant_id,
"analytics_id": account.analytics_id,
}
backend = account.backend
try:
albums = backend.get_all_albums()
except Exception, e:
# raise e
albums = []
示例2: add
# 需要导入模块: from account.models import Account [as 别名]
# 或者: from account.models.Account import put [as 别名]
def add(account):
if request.method == "POST":
account = Account()
account.email = request.form["email"]
account.role = request.form["role"]
account.put()
flash(u"Account added!")
return render_template("account/accounts.html", account=account, accounts=Account.query())
else:
return render_template("account/account_add.html", account=account)