當前位置: 首頁>>代碼示例>>Python>>正文


Python PageData.accessreq方法代碼示例

本文整理匯總了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)
開發者ID:oamike,項目名稱:scarfage,代碼行數:17,代碼來源:image.py

示例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)
開發者ID:oamike,項目名稱:scarfage,代碼行數:18,代碼來源:image.py

示例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)
開發者ID:cmazuc,項目名稱:scarfage,代碼行數:18,代碼來源:items.py


注:本文中的main.PageData.accessreq方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。