本文整理匯總了Python中webapp2_extras.appengine.auth.models.User.get方法的典型用法代碼示例。如果您正苦於以下問題:Python User.get方法的具體用法?Python User.get怎麽用?Python User.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類webapp2_extras.appengine.auth.models.User
的用法示例。
在下文中一共展示了User.get方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: delete_orphaned_article_approvalsAction
# 需要導入模塊: from webapp2_extras.appengine.auth.models import User [as 別名]
# 或者: from webapp2_extras.appengine.auth.models.User import get [as 別名]
def delete_orphaned_article_approvalsAction(self):
page=0
limit=100
records=[0]
num_deleted=0
total_records=0
while records:
records=ArticleApproveModel.all().fetch(limit,page*limit)
for record in records:
total_records=total_records+1
if not record.parent():
record.delete()
num_deleted=num_deleted+1
else:
category=CategoryModel.get(record.category.key())
if not category:
record.delete()
num_deleted=num_deleted+1
else:
user=User.get(record.user.key())
if not user:
record.delete()
num_deleted=num_deleted+1
page=page+1
return DevView(DevModel())