当前位置: 首页>>代码示例>>Python>>正文


Python Alert.alert_msg_notfound方法代码示例

本文整理汇总了Python中myapp.Alert.Alert.alert_msg_notfound方法的典型用法代码示例。如果您正苦于以下问题:Python Alert.alert_msg_notfound方法的具体用法?Python Alert.alert_msg_notfound怎么用?Python Alert.alert_msg_notfound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在myapp.Alert.Alert的用法示例。


在下文中一共展示了Alert.alert_msg_notfound方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get

# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_notfound [as 别名]
	def get(self):
		try:
			bbs=db.get(self.request.get("bbs_key"))
		except:
			bbs=None
		if(bbs==None):
			Alert.alert_msg_notfound(self)
			return			
		host_url=MappingId.mapping_host_with_scheme(self.request)+"/";
		url=MappingId.get_usr_url(host_url,bbs)
		self.redirect(str(url))
开发者ID:abars,项目名称:illustbook,代码行数:13,代码来源:RedirectBbs.py

示例2: get

# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_notfound [as 别名]
	def get(self,bbs_key,thread_key):
		SetUtf8.set()

		#ホストチェック
		if SpamCheck.is_deny(self.request):
			self.response.set_status(401)
			return

		#英語版かどうか
		is_english=CssDesign.is_english(self)

		#BBSを取得
		bbs_key=MappingId.mapping(bbs_key)
		bbs=ApiObject.get_cached_object(bbs_key)
		if(bbs == None):
			Alert.alert_msg_notfound(self)
			return

		#BBSが削除されていた場合
		if(bbs.del_flag) :
			if(is_english):
				Alert.alert_msg_with_write(self,"This bbs was deleted.")
			else:
				Alert.alert_msg_with_write(self,"このBBSは削除されました。")
			return
		
		#ページ番号を取得
		col_num = 10
		page = 1
		if self.request.get("page"):
			page = int(self.request.get("page"))
			if page < 1:
				page=1
		
		#メンテナンス画面
		is_maintenance=0
		if(MaintenanceCheck.is_appengine_maintenance()):
			is_maintenance=1

		#オーダー取得
		order="update"
		if(bbs.default_comment_order==1):
			order="new"
		if self.request.get("order"):
			order=self.request.get("order")
		
		#スレッド取得
		thread=ShowThread.get_thread(bbs,thread_key)
		if(thread == None):
			Alert.alert_msg_notfound(self)
			return

		#コメント数を更新
		if(bbs.page_comment_n):
			col_num=bbs.page_comment_n
		if(self.request.get("limit")):
			col_num=int(self.request.get("limit"))

		#コメントの一覧を取得
		query=ShowThread.get_comment_query(thread,order)
		entry_num = query.count()
		if(entry_num==0):
			com_list_ = []
		else:
			com_list_ = query.fetch(limit=col_num, offset=(page-1)*col_num)
		
		#検索
		search=""
		if(self.request.get("search")):
			search=self.request.get("search")
			query=""+search+' thread_key:"'+str(thread.key())+'"'
			com_list_=SearchThread.search(query,page,col_num,BbsConst.SEARCH_ENTRY_INDEX_NAME)
		
		#実体への変換
		com_list_=ApiObject.get_cached_object_list(com_list_)

		#現在のスレッドへのURLを取得
		host_url=MappingId.mapping_host_with_scheme(self.request)+"/"
		
		#編集モードか
		user = users.get_current_user()
		edit_flag = 0
		if(not OwnerCheck.check(bbs,user)):
			edit_flag = 1

		logined=0
		if(user):
			logined=1

		owner=user
		if(OwnerCheck.check(bbs,user)):
			owner=None

		admin_user=OwnerCheck.is_admin(user)

		#ページリンクを作成
		page_url_base = MappingId.get_usr_url(host_url,bbs)+thread_key+'.html?page='
		page_list=ShowThread.create_page_list(page,entry_num,col_num)
		
		#掲示板のデザインを取得
#.........这里部分代码省略.........
开发者ID:abars,项目名称:illustbook,代码行数:103,代码来源:ShowThread.py

示例3: get

# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_notfound [as 别名]
    def get(self):
        SetUtf8.set()

        page_name = ""
        mode = "access"
        if self.request.get("mode"):
            mode = self.request.get("mode")

        bbs = None

        user = None
        if page_name == "":
            try:
                bbs = db.get(self.request.get("bbs_key"))
            except:
                bbs = None
            if bbs == None:
                Alert.alert_msg_notfound(self)
                return

            user = users.get_current_user()
            if user:
                if bbs.user_id != user.user_id():
                    user = None

            page_name = bbs.bbs_name

        if self.request.get("start_date"):
            start_date = self.request.get("start_date")
            if not self.validate_date(start_date):
                Alert.alert_msg_with_write(self, "日付指定は0000-00-00形式である必要があります。")
                return
        else:
            start_date = str(datetime.date.today() + datetime.timedelta(days=-31))

        if self.request.get("end_date"):
            end_date = self.request.get("end_date")
            if not self.validate_date(end_date):
                Alert.alert_msg_with_write(self, "日付指定は0000-00-00形式である必要があります。")
                return
        else:
            end_date = str(datetime.date.today() + datetime.timedelta(days=-1))

        start_day = datetime.datetime.strptime(start_date, "%Y-%m-%d")
        end_day = datetime.datetime.strptime(end_date, "%Y-%m-%d")
        if start_day > end_day:
            Alert.alert_msg_with_write(self, "終了日よりも開始日の方が大きくなっています。")
            return

        bbs_id = bbs.short
        is_admin = OwnerCheck.is_admin(user)
        if is_admin:
            if self.request.get("bbs_id"):
                bbs_id = self.request.get("bbs_id")
                if bbs.short != bbs_id:
                    page_name = bbs_id

        page_list = None
        ref_list = None
        keyword_list = None
        access_list = None

        show_analyze = False
        if user or bbs.short == "sample":
            show_analyze = True

        if show_analyze:
            try:
                result = self.get_analytics(mode, bbs_id, start_date, end_date)
            except:
                time.sleep(1)
                try:
                    result = self.get_analytics(mode, bbs_id, start_date, end_date)
                except:
                    Alert.alert_msg_with_write(self, "Analytics APIへのアクセスに失敗しました。リロードして下さい")
                    logging.error("failed analytics api")
                    return

            if mode == "page":
                page_list = result
            if mode == "ref":
                ref_list = result
            if mode == "keyword":
                keyword_list = result
            if mode == "access":
                access_list = result

        quota_error = mode == "access" and not access_list

        redirect_api = (
            "analyze?start_date="
            + start_date
            + "&amp;end_date="
            + end_date
            + "&amp;bbs_id="
            + bbs_id
            + "&amp;bbs_key="
            + str(bbs.key())
            + "&amp;"
        )
#.........这里部分代码省略.........
开发者ID:abars,项目名称:illustbook,代码行数:103,代码来源:AnalyzeAccess.py


注:本文中的myapp.Alert.Alert.alert_msg_notfound方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。