本文整理汇总了Python中myapp.Alert.Alert.alert_msg_with_write方法的典型用法代码示例。如果您正苦于以下问题:Python Alert.alert_msg_with_write方法的具体用法?Python Alert.alert_msg_with_write怎么用?Python Alert.alert_msg_with_write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myapp.Alert.Alert
的用法示例。
在下文中一共展示了Alert.alert_msg_with_write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: withdraw
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def withdraw(self,bookmark,your_bbs_count):
user_id=self.request.get("user_id")
if(not user_id):
Alert.alert_msg_with_write(self,"ユーザIDが必要です。")
return True
user=users.get_current_user()
bookmark=ApiObject.get_bookmark_of_user_id_for_write(user_id) #キャッシュから取得するのを防止
if(not bookmark):
Alert.alert_msg_with_write(self,"ユーザが見つかりません。")
return True
if(OwnerCheck.check_bookmark(bookmark,user)):
Alert.alert_msg_with_write(self,"退会する権限がありません。")
return True
is_english=CssDesign.is_english(self)
if(your_bbs_count==0):
#delete_user_thread(user.user_id()) #他人の掲示板に描いたイラストは慎重に削除する必要がある気がする
bookmark.delete()
msg="退会が完了しました。"
if(is_english):
msg="Complete"
Alert.alert_msg_with_write(self,msg);
else:
msg="退会する前にレンタルしている掲示板を削除する必要があります。<BR>掲示板の削除はマイページのイラストタブで編集を押すことで行うことができます。<BR>残りの掲示板数:"+str(your_bbs_count)
if(is_english):
msg="You must delete your BBS before withdraw.<br/>You have "+str(your_bbs_count)+" BBS yet."
Alert.alert_msg_with_write(self,msg)
return True
return True
示例2: get
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def get(self):
try:
thread = db.get(self.request.get("thread_key"))
bbs = db.get(self.request.get("bbs_key"))
except:
thread = None
bbs = None
if thread == None or bbs == None:
Alert.alert_msg_with_write(self, "拍手対象のスレッドが見つかりません。")
return
not_spam = (
self.request.remote_addr != thread.applause_ip
and self.request.remote_addr != thread.applause_ip2
and self.request.remote_addr != thread.applause_ip3
and self.request.remote_addr != thread.applause_ip4
)
if not_spam or self.request.get("comment"):
if thread.applause:
thread.applause = thread.applause + 1
else:
thread.applause = 1
thread.applause_ip4 = thread.applause_ip3
thread.applause_ip3 = thread.applause_ip2
thread.applause_ip2 = thread.applause_ip
thread.applause_ip = self.request.remote_addr
thread.applause_date = datetime.datetime.today()
thread.search_index_version = 0
thread.put()
if bbs.applause_n:
bbs.applause_n = bbs.applause_n + 1
else:
bbs.applause_n = 1
bbs.put()
user = users.get_current_user()
comment = ""
if self.request.get("comment"):
comment = self.request.get("comment")
StackFeed.feed_new_applause_thread(user, thread, comment)
Ranking.add_rank_global(thread, BbsConst.SCORE_APPLAUSE)
if self.request.get("mode") == "bbs":
order = self.request.get("order")
page = self.request.get("page")
self.redirect(str(MappingId.get_usr_url("./", bbs) + "?order=" + order + "&page=" + page))
else:
thread_url = self.request.get("thread_key")
if thread.short:
thread_url = thread.short
self.redirect(str(MappingId.get_usr_url("./", bbs) + thread_url + ".html"))
示例3: get
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def get(self):
try:
bbs = db.get(self.request.get("bbs_key"))
except:
Alert.alert_msg_with_write(self,"掲示板の編集画面のURLが変更されています。掲示板からログインし、デザインの編集ボタンをクリックして下さい。")
return
user = users.get_current_user()
is_admin=0
if(user and OwnerCheck.is_admin(user)):
is_admin=1
if(bbs.short!="sample" and OwnerCheck.check(bbs,user) and not is_admin):
Alert.alert_msg_with_write(self,"デザインの編集の権限がありません。")
return
error_str=""
if self.request.get("error_str"):
error_str=self.request.get("error_str")
is_css_enable=OwnerCheck.is_admin(user)
my_app_list=None
if(user):
my_app_list=AppCode.all().filter("user_id =",user.user_id()).filter("mode =",2).fetch(limit=100,offset=0)
tab="all"
if(self.request.get("tab")):
tab=self.request.get("tab")
bbs_css=None
try:
bbs_css=bbs.css
except:
bbs_css=None
template_values = {
'host': './',
'bbs': bbs,
'error_str': error_str,
'is_css_enable': is_css_enable,
'is_admin': is_admin,
'is_iphone': CssDesign.is_iphone(self),
'is_tablet': CssDesign.is_tablet(self),
'my_app_list': my_app_list,
'user': user,
'tab': tab,
'redirect_url': self.request.path,
'bbs_css': bbs_css,
'is_english': CssDesign.is_english(self)
}
path = '/html/edit_bbs.html'
self.response.out.write(template_select.render(path, template_values))
示例4: violate_icon
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def violate_icon(self):
bookmark = ApiObject.get_bookmark_of_user_id_for_write(self.request.get("user_id"))
if bookmark == None:
Alert.alert_msg_with_write(self, "ブックマークの取得に失敗しました。")
return
bookmark.thumbnail_created = BbsConst.USER_ICON_THUMBNAIL_VIOLATE
bookmark.icon = None
bookmark.icon_content_type = None
bookmark.icon_mini = None
bookmark.icon_mini_content_type = None
bookmark.put()
self.redirect("./mypage?user_id=" + self.request.get("user_id"))
示例5: post
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def post(self):
bbs=db.get(self.request.get("bbs_key"));
try:
thread=db.get(self.request.get("thread_key"))
except:
thread=None
try:
entry=db.get(self.request.get("entry_key"))
except:
entry=None
try:
res=db.get(self.request.get("res_key"))
except:
res=None
user = users.get_current_user()
bbs_owner=not OwnerCheck.check(bbs,user)
thread_owner=False
if(user):
if(thread and user.user_id()==thread.user_id):
thread_owner=True
if(entry and user.user_id()==entry.user_id):
thread_owner=True
if(res and user.user_id()==res.user_id):
thread_owner=True
if(not bbs_owner and not thread_owner and not OwnerCheck.is_admin(user)):
Alert.alert_msg_with_write(self,"更新する権限がありません。");
return
if(thread):
if(self.update_thread(bbs,thread,user)):
return
if(entry):
if(self.update_entry(entry,user)):
return
thread=entry.thread_key
if(res):
entry=db.get(self.request.get("res_entry_key"))
if(self.update_res(res,entry,user)):
return
thread=entry.thread_key
url=MappingThreadId.get_thread_url("./",bbs,thread)
if(entry or res):
url=url+"?comment_edit=1"
self.redirect(str(url))
示例6: update_thread
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def update_thread(self,bbs,thread,user):
compiled_line = re.compile("\r\n|\r|\n")
title = self.request.get('thread_title')
title=self.escape_comment(title)
thread.title = title
thread.author=self.request.get('thread_author')
category = self.request.get("thread_category")
thread.category=category
CategoryList.add_new_category(bbs,category)
event_id = self.request.get("event_id")
thread.event_id=event_id
summary = self.request.get('thread_summary')
summary = compiled_line.sub(r'', summary)
thread.summary = summary
postscript = self.request.get('thread_postscript')
postscript = compiled_line.sub(r'', postscript)
thread.postscript = postscript
new_show_in_portal = int(self.request.get('dont_show_in_portal'))
if((thread.violate_photo and not new_show_in_portal) or (not thread.violate_photo and new_show_in_portal)):
ApiFeed.invalidate_cache()
thread.violate_photo = new_show_in_portal
self.link_to_profile(thread,user)
thread.adult=int(self.request.get("regulation"))
#thread.hidden_in_list = int(self.request.get('hidden_in_list'))
try:
thread.comment_cnt = int(self.request.get('comment_cnt'))
except:
Alert.alert_msg_with_write(self,"コメント数は数値である必要があります。");
return True
thread.search_index_version=0 #インデックス更新
thread.put()
if(thread.user_id):
ApiUser.invalidate_thread_count(thread.user_id)
return False
示例7: post
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def post(self,mode_url):
mode=self.request.get("mode")
user = users.get_current_user()
if(not user):
Alert.alert_msg_with_write(self,"ログインが必要です。")
return
msg=""
if(mode=="add"):
if(Event.all().filter("id =",self.request.get("id")).count()>=1):
Alert.alert_msg_with_write(self,"このIDのイベントは既に存在しています")
return
event=Event()
if(not self._update(event,user,True,True)):
return
event.put()
if(mode=="edit"):
event=Event.all().filter("id =",self.request.get("id")).fetch(limit=2)
if(not event or len(event)==0):
Alert.alert_msg_with_write(self,"イベントが存在しません")
return
if(len(event)>=2):
Alert.alert_msg_with_write(self,"イベントが重複しています")
return
event=event[0]
if(not self._update(event,user,True,False)):
return
event.put()
if(mode=="del"):
event=Event.all().filter("id =",self.request.get("id")).fetch(limit=2)
if(not event or len(event)==0):
Alert.alert_msg_with_write(self,"イベントが存在しません")
return
event[0].delete()
host=MappingId.mapping_host_with_scheme(self.request)+"/"
if(mode=="del"):
self.redirect(str(host+"?order=event"))
else:
self.redirect(str(host+"?order=event&event_id="+event.id))
示例8: get
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def get(self):
SetUtf8.set()
user = users.get_current_user()
if user:
if not OwnerCheck.is_admin(user):
Alert.alert_msg_with_write(self, "権限がありません。")
return
if self.request.get("user_id"):
self.violate_icon()
return
if self.request.get("entry_key"):
self.violate_entry()
return
self.violate_thread()
示例9: post
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def post(self):
SetUtf8.set()
try:
bbs = db.get(self.request.get("bbs_key"))
except:
Alert.alert_msg_with_write(self,"掲示板の取得に失敗しました。")
return
user = users.get_current_user()
if(OwnerCheck.check(bbs,user) and not OwnerCheck.is_admin(user)):
Alert.alert_msg_with_write(self,"削除する権限がありません。")
return
category_count=self.update_category()
link_count=self.update_link(user)
deleted_count=self.delete_thread(bbs)
page=self.request.get("page")
order=self.request.get("order")
url="./edit_thread_list?bbs_key="+str(bbs.key())+"&page="+str(page)+"&order="+order+"&deleted_count="+str(deleted_count)+"&category_count="+str(category_count)+"&link_count="+str(link_count)
self.redirect(str(url))
示例10: get
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def get(self,mode_url):
mode=self.request.get("mode")
if(mode=="edit"):
event=Event.all().filter("id =",self.request.get("id")).fetch(limit=2)
if(not event or len(event)==0):
Alert.alert_msg_with_write(self,"イベントが存在しません")
return
else:
if(Event.all().filter("id =",self.request.get("id")).count()>=1):
Alert.alert_msg_with_write(self,"このIDは既に使われています")
return
user = users.get_current_user()
event=Event()
if(not self._update(event,user,False,False)):
return
Alert.alert_msg_with_write(self,"このイベントは作成可能です")
示例11: get
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def get(self):
SetUtf8.set()
is_english=CssDesign.is_english(self)
short=self.request.get('id')
if(MappingId.key_format_check(short)):
txt="IDは半角英数である必要があります。"
if(is_english):
txt="ID must be 16 characters or less"
Alert.alert_msg_with_write(self,txt)
return
if(MappingId.check_capability(short,"")==0):
txt="ID:"+short+"は既に登録されていて利用できません。"
if(is_english):
txt="ID:"+short+" is not available"
Alert.alert_msg_with_write(self,txt)
return
txt="ID:"+short+"は利用可能です。"
if(is_english):
txt="ID:"+short+" is available"
Alert.alert_msg_with_write(self,txt)
示例12: post
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def post(self):
bbs_key=self.request.get("bbs_key")
short=self.request.get('short')
if(MappingId.key_format_check(short)):
Alert.alert_msg_with_write(self,"IDは半角英数である必要があります。")
return
if(MappingId.check_capability(short,bbs_key)==0):
Alert.alert_msg_with_write(self,"ID:"+short+"は既に登録されています。")
return
bbs=db.get(bbs_key);
user = users.get_current_user()
if(OwnerCheck.check(bbs,user) and not OwnerCheck.is_admin(user)):
Alert.alert_msg_with_write(self,"デザインの編集を行う権限がありません。")
return
summary = self.request.get('bbs_summary')
bg_color=self.format_color(self.request.get('bg_color'))
font_color=self.format_color(self.request.get('font_color'))
hr_color=self.format_color(self.request.get('hr_color'))
content_bg_color=self.format_color(self.request.get('content_bg_color'))
content_font_color=self.format_color(self.request.get('content_font_color'))
menu_bg_color=self.format_color(self.request.get('menu_bg_color'))
menu_font_color=self.format_color(self.request.get('menu_font_color'))
side_color=self.format_color(self.request.get('side_color'))
side_font_color=self.format_color(self.request.get('side_font_color'))
twitter_bg_color=self.format_color(self.request.get('twitter_bg_color'))
twitter_font_color=self.format_color(self.request.get('twitter_font_color'))
twitter_shell_color=self.format_color(self.request.get('twitter_shell_color'))
if(menu_bg_color=="None"):
menu_bg_color="ffffff";
if(menu_font_color=="None"):
menu_font_color="333333";
if(content_bg_color=="None"):
content_bg_color="ffffff";
if(content_font_color=="None"):
content_font_color="333333";
if(hr_color=="None"):
hr_color="b5ae9d";
if(side_color=="None"):
side_color="ffffff";
if(side_font_color=="None"):
side_font_color="333333";
if(twitter_bg_color=="None"):
twitter_bg_color="ffffff";
if(twitter_font_color=="None"):
twitter_font_color="333333";
if(twitter_shell_color=="None"):
twitter_shell_color="ffffff";
if re.match('[0-9a-fA-F]{1,6}', bg_color) == None:
error_str="bg_color is invalid"
self.redirect(str('./edit_bbs?bbs_key='+self.request.get("bbs_key")+'&error_str='+error_str))
return
if re.match('[0-9a-fA-F]{1,6}', font_color) == None:
error_str="font_color is invalid"
self.redirect(str('./edit_bbs?bbs_key='+self.request.get("bbs_key")+'&error_str='+error_str))
return
if re.match('[0-9a-fA-F]{1,6}', hr_color) == None:
error_str="hr_color is invalid"
self.redirect(str('./edit_bbs?bbs_key='+self.request.get("bbs_key")+'&error_str='+error_str))
return
if re.match('[0-9a-fA-F]{1,6}', twitter_bg_color) == None:
error_str="twitter_bg_color is invalid"
self.redirect(str('./edit_bbs?bbs_key='+self.request.get("bbs_key")+'&error_str='+error_str))
return
if re.match('[0-9a-fA-F]{1,6}', twitter_font_color) == None:
error_str="twitter_font_color is invalid"
self.redirect(str('./edit_bbs?bbs_key='+self.request.get("bbs_key")+'&error_str='+error_str))
return
if re.match('[0-9a-fA-F]{1,6}', side_color) == None:
error_str="side_color is invalid"
self.redirect(str('./edit_bbs?bbs_key='+self.request.get("bbs_key")+'&error_str='+error_str))
return
if re.match('[0-9a-fA-F]{1,6}', side_font_color) == None:
error_str="side_font_color is invalid"
self.redirect(str('./edit_bbs?bbs_key='+self.request.get("bbs_key")+'&error_str='+error_str))
return
if re.match('[0-9a-fA-F]{1,6}', content_bg_color) == None:
error_str="content_color is invalid"
self.redirect(str('./edit_bbs?bbs_key='+self.request.get("bbs_key")+'&error_str='+error_str))
return
if re.match('[0-9a-fA-F]{1,6}', content_font_color) == None:
error_str="content_font_color is invalid"
self.redirect(str('./edit_bbs?bbs_key='+self.request.get("bbs_key")+'&error_str='+error_str))
return
if re.match('[0-9a-fA-F]{1,6}', menu_bg_color) == None:
error_str="menu_color is invalid"
self.redirect(str('./edit_bbs?bbs_key='+self.request.get("bbs_key")+'&error_str='+error_str))
return
if re.match('[0-9a-fA-F]{1,6}', menu_font_color) == None:
error_str="menu_font_color is invalid"
self.redirect(str('./edit_bbs?bbs_key='+self.request.get("bbs_key")+'&error_str='+error_str))
return
if self.request.get('title'):
bbs.bbs_name=self.request.get('title')
#.........这里部分代码省略.........
示例13: get
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def get(self,regist_mode):
SetUtf8.set()
#表示モードかどうか
view_mode=None
if(self.request.get("user")):
view_mode=self.request.get("user")
#ユーザ検索
if(self.request.get("user_id")):
target_bookmark=ApiObject.get_bookmark_of_user_id(self.request.get("user_id"))
if(target_bookmark==None):
Alert.alert_msg_with_write(self,"ユーザが見つかりません。")
return
view_mode=str(target_bookmark.key());
#リダイレクトURL
host=MappingId.mapping_host_with_scheme(self.request)+"/";
redirect_url=host+"mypage";
#編集モードか
edit_mode=0
if(self.request.get("edit")):
edit_mode=int(self.request.get("edit"))
#掲示板一覧
user = users.get_current_user()
favorite=""
bookmark=None
#管理人かどうか
is_admin=0
if(OwnerCheck.is_admin(user)):# and self.request.get("is_admin")):
is_admin=1
#自分だったらビューモードにしない
if(user and self.request.get("user_id")==user.user_id() and not self.request.get("withdraw")):
view_mode=0
#ログインしているか
login_flag=0
if(user):
login_flag=1
#表示設定
if(view_mode):
bookmark=db.get(view_mode)
else:
if user:
bookmark=ApiObject.get_bookmark_of_user_id(user.user_id())
else:
bookmark=None
#掲示板の新規作成が完了したか
regist_finish=False
if(regist_mode=="regist"):
regist_finish=True
#プロフィールを編集
edit_profile=Pinterest.get_profile_for_edit(bookmark,view_mode)
#アカウントの凍結
if(self.request.get("freez") and is_admin):
bookmark=ApiObject.get_bookmark_of_user_id_for_write(self.request.get("user_id"))
bookmark.frozen=int(self.request.get("freez"))
bookmark.put()
#退会
if(self.request.get("withdraw") and self.request.get("withdraw")=="go"):
if(not bookmark):
Alert.alert_msg_with_write(self,"ユーザ情報は未登録です。");
return
your_bbs_count=Bbs.all().filter("del_flag =",0).filter("user_id =",bookmark.user_id).count()
if(self.withdraw(bookmark,your_bbs_count)):
return;
#リダイレクト
if(BbsConst.PINTEREST_MODE):
if((user and OwnerCheck.is_admin(user)) or BbsConst.PINTEREST_MODE==2):
if(regist_finish):
return Pinterest.get_core(self,Pinterest.PAGE_MODE_REGIST)
else:
return Pinterest.get_core(self,Pinterest.PAGE_MODE_MYPAGE)
示例14: post
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def post(self):
if(self.request.get('bbs_title')==""):
Alert.alert_msg_with_write(self,"タイトルを入力して下さい。");
return
if(self.request.get('bbs_summary')==""):
Alert.alert_msg_with_write(self,"概要を入力して下さい。");
return
user = users.get_current_user()
summary = self.request.get('bbs_summary')
if(int(self.request.get('official'))==1):
Alert.alert_msg_with_write(self,"オフィシャル掲示板は廃止されました。");
return
if (not user):
if(int(self.request.get('official'))==0):
self.redirect(str(users.create_login_url("")))
return
#summary = cgi.escape(summary)
compiled_line = re.compile("\r\n|\r|\n")
summary = compiled_line.sub(r'<br>', summary)
short=self.request.get('short')
if(MappingId.key_format_check(short)):
Alert.alert_msg_with_write(self,"IDは半角英数である必要があります。")
return
if(MappingId.check_capability(short,"")==0):
Alert.alert_msg_with_write(self,"ID:"+short+"は既に登録されています。")
return
if(short==""):
Alert.alert_msg_with_write(self,"IDを入力する必要があります。")
return
new_bbs = Bbs()
new_bbs.official=int(self.request.get('official'))
new_bbs.illust_n=0
new_bbs.bbs_name = cgi.escape(self.request.get('bbs_title'))
new_bbs.summary = summary
new_bbs.owner = user
new_bbs.user_id = user.user_id()
new_bbs.bg_color="ffffff"
new_bbs.font_color="333333"
new_bbs.background_image=""
new_bbs.bottom_image=""
new_bbs.button_color="999999"
new_bbs.button_active_color="777777"
new_bbs.bbs_mode=int(self.request.get('mode'))
new_bbs.my_homepage=""
new_bbs.del_flag=0
new_bbs.enable_continue_draw=0
new_bbs.enable_moper=0
new_bbs.enable_full_flat=1
new_bbs.short=short
new_bbs.delete_when_upload_success=1
new_bbs.applause_n=0
new_bbs.illust_n=0
new_bbs.comment_n=0
new_bbs.page_illust_n=5
new_bbs.page_comment_n=10
new_bbs.disable_applause=0
new_bbs.default_order=0
new_bbs.enable_illust_reply=1
new_bbs.enable_illust_reply_continue=0
new_bbs.disable_normal_reply=0
new_bbs.illust_reply_width=400
new_bbs.illust_reply_height=200
new_bbs.side_color="ffffff"
new_bbs.side_font_color="333333"
new_bbs.side_background_image=""
new_bbs.comment_rule_enable=0
new_bbs.comment_rule=""
new_bbs.default_canvas_size=0
new_bbs.default_canvas_width=0
new_bbs.default_canvas_height=0
new_bbs.disable_counter=0
new_bbs.disable_draw_time=0
new_bbs.disable_portal_menu=0
new_bbs.in_frame_mode=0;
new_bbs.spoit_mode=0;
new_bbs.disable_news=0;
new_bbs.twitter_id=""
new_bbs.twitter_enable=0
new_bbs.twitter_bg_color="ffffff"
new_bbs.twitter_font_color="333333"
new_bbs.twitter_shell_color="ffffff"
new_bbs.twitter_height=300
new_bbs.design_template_no=1
new_bbs.content_bg_color="ffffff"
new_bbs.content_font_color="333333"
#.........这里部分代码省略.........
示例15: get
# 需要导入模块: from myapp.Alert import Alert [as 别名]
# 或者: from myapp.Alert.Alert import alert_msg_with_write [as 别名]
def get(self):
SetUtf8.set()
try:
bbs = db.get(self.request.get("bbs_key"))
except:
Alert.alert_msg_with_write(self,"掲示板の取得に失敗しました。")
return
user = users.get_current_user()
if(OwnerCheck.check(bbs,user) and not OwnerCheck.is_admin(user)):
Alert.alert_msg_with_write(self,"削除する権限がありません。")
return
user = users.get_current_user()
page=1
if(self.request.get("page")):
page=int(self.request.get("page"))
order="new"
if(self.request.get("order")):
order=self.request.get("order")
limit=20
offset=(page-1)*limit
query=db.Query(MesThread,keys_only=True)
query.filter("bbs_key =",bbs)
if(order=="new"):
query.order("-create_date")
else:
query.order("create_date")
thread_key_list=query.fetch(offset=offset,limit=limit)
thread_list=[]
for thread_key in thread_key_list:
try:
thread_list.append(db.get(thread_key))
except:
continue
deleted_count=self.request.get("deleted_count")
category_count=self.request.get("category_count")
link_count=self.request.get("link_count")
if(deleted_count):
deleted_count=int(deleted_count)
if(category_count):
category_count=int(category_count)
if(link_count):
link_count=int(link_count)
category_list=CategoryList.get_category_list(bbs)
template_values = {
'host': './',
'bbs': bbs,
'user': user,
'thread_list': thread_list,
'redirect_url': self.request.path,
'page': page,
'order': order,
'deleted_count': deleted_count,
'category_count': category_count,
'link_count': link_count,
'is_iphone': CssDesign.is_iphone(self),
'is_tablet': CssDesign.is_tablet(self),
'category_list': category_list,
'is_english': CssDesign.is_english(self)
}
path = '/html/edit_thread_list.html'
self.response.out.write(template_select.render(path, template_values))