本文整理匯總了Python中main.PageData.conftarget方法的典型用法代碼示例。如果您正苦於以下問題:Python PageData.conftarget方法的具體用法?Python PageData.conftarget怎麽用?Python PageData.conftarget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類main.PageData
的用法示例。
在下文中一共展示了PageData.conftarget方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: reallydelete_image
# 需要導入模塊: from main import PageData [as 別名]
# 或者: from main.PageData import conftarget [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 conftarget [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 conftarget [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)