本文整理汇总了Python中main.PageData.accessreq方法的典型用法代码示例。如果您正苦于以下问题:Python PageData.accessreq方法的具体用法?Python PageData.accessreq怎么用?Python PageData.accessreq使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类main.PageData
的用法示例。
在下文中一共展示了PageData.accessreq方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reallydelete_image
# 需要导入模块: from main import PageData [as 别名]
# 或者: from main.PageData import accessreq [as 别名]
def reallydelete_image(img_id):
pd = PageData()
try:
delimg = SiteImage.create(img_id)
delimg.delete()
except NoImage:
return page_not_found(404)
pd.title = delimg.tag + " has been deleted"
pd.accessreq = 10
pd.conftext = delimg.tag + " has been deleted. I hope you meant to do that."
pd.conftarget = ""
pd.conflinktext = ""
return render_template('confirm.html', pd=pd)
示例2: delete_image
# 需要导入模块: from main import PageData [as 别名]
# 或者: from main.PageData import accessreq [as 别名]
def delete_image(img_id):
pd = PageData()
try:
delimg = SiteImage.create(img_id)
except NoImage:
return page_not_found(404)
pd.title=delimg.tag
pd.accessreq = 10
pd.conftext = "Deleting image " + delimg.tag
pd.conftarget = "/image/" + img_id + "/reallydelete"
pd.conflinktext = "Yup, I'm sure"
return render_template('confirm.html', pd=pd)
示例3: delete_item
# 需要导入模块: from main import PageData [as 别名]
# 或者: from main.PageData import accessreq [as 别名]
def delete_item(item_id):
try:
delitem = SiteItem.create(item_id)
except NoItem:
return page_not_found()
pd = PageData()
pd.title=delitem.name
pd.accessreq = 255
pd.conftext = "Items may take some time to disappear from the indexes."
pd.conftarget = "/item/" + str(delitem.uid) + "/reallydelete"
pd.conflinktext = "I want to delete '{}' and accept the consequences of this action.".format(delitem.name)
return render_template('confirm.html', pd=pd)