def FeedTplEdit(self): stype = -1 version = -1 tpl_id = -1 if "stype" in request.params: stype = int(request.params['stype']) if "version" in request.params: version = int(request.params['version']) if "tpl_id" in request.params: tpl_id = int(request.params['tpl_id']) ver = self.data_version_.filter_by(stype=stype, version=version).first() if not ver: return "参数错误" tpl_using = 0 if tpl_id > 0 and tpl_id == ver.using_tpl_id: tpl_using = 1 return render( '/feed-tpl-edit.mako', { "stype": stype, "version": version, "tpl_id": tpl_id, "tpl_using": tpl_using, "user_right": self.UserRight(request, response) })
def FeedKeysEdit(self): stype = -1 version = -1 is_user = 0 apply_id = 0 from_tpl_id = 0 if "stype" in request.params: stype = int(request.params['stype']) if "version" in request.params: version = int(request.params['version']) if "apply_id" in request.params and "from_tpl_id" in request.params: apply_id = int(request.params['apply_id']) from_tpl_id = int(request.params['from_tpl_id']) if "is_user" in request.params: is_user = int(request.params['version']) return render( '/feed-keys-edit.mako', { "stype": stype, "user_right": self.UserRight(request, response), "version": version, "from_tpl_id": from_tpl_id, "apply_id": apply_id, "is_user": is_user })
def FeedKeysEdit(self): stype = -1 version = -1 is_user = 0 apply_id = 0 from_tpl_id = 0 if "stype" in request.params: stype = int(request.params['stype']) if "version" in request.params: version = int(request.params['version']) if "apply_id" in request.params and "from_tpl_id" in request.params: apply_id = int(request.params['apply_id']) from_tpl_id = int(request.params['from_tpl_id']) if "is_user" in request.params: is_user = int(request.params['version']) return render('/feed-keys-edit.mako', {"stype" : stype, "user_right" : self.UserRight(request, response), "version" : version, "from_tpl_id" : from_tpl_id, "apply_id" : apply_id, "is_user" : is_user})
def FeedListView(self): list_filter = 0 if "filter" in request.params: list_filter = int(request.params['filter']) return render( '/feed-list.mako', { "user_right": self.UserRight(request, response), "list_filter": list_filter })
def StypeConfigEdit(self): stype = -1 from_version_id = 0 apply_id = 0 uid = 0 if "id" in request.cookies: uid = int(request.cookies['id']) if "stype" in request.params: stype = int(request.params['stype']) if "apply_id" in request.params and "from_version_id" in request.params: apply_id = int(request.params['apply_id']) from_version_id = int(request.params['from_version_id']) return render('/feed-config-edit.mako', {"stype" : stype, "user_right" : self.UserRight(request, response), "apply_id" : apply_id, "from_version_id" : from_version_id})
def GetStypeConfig(self): cfg = self.stype_config_.filter_by(stype=int(request.params['stype'])).first() if not cfg: cfg = StypeConfig(stype = int(request.params['stype']), weight = 1, type = int(request.params['stype']) / 100, ptype = 0, description = '', push_feed_flags = 0, news_merge_type = 0, mini_merge_type = 0, update_time_on_merge = 0, custom_expr = 0, persist_body = 0, persist_feeddb = 0, lifetime = 0, daily_quota = 0, news_merge_by = '', mini_merge_by = '', source_by = '', psource_by = '', actor_by = '', dispatch_expr = '') print cfg.description return render('/feed-config.mako', { "stype" : cfg.stype, "type" : cfg.type, "weight" : cfg.weight, "desc" : cfg.description.decode('utf-8'), "ptype" : cfg.ptype, "save_content" : cfg.is_persist_content, "save_feed_db" : cfg.is_persist_feeddb, "news_merge_type" : cfg.news_merge_type, "mini_merge_type" : cfg.mini_merge_type, "push_flags" : cfg.push_flag, "custom_expr" : cfg.is_custom_expr, "update_time_on_merge" : cfg.is_update_time, "lifetime" : cfg.lifetime, "daily_quota" : cfg.daily_quota } )
def GetStypeConfig(self): cfg = self.stype_config_.filter_by( stype=int(request.params['stype'])).first() if not cfg: cfg = StypeConfig(stype=int(request.params['stype']), weight=1, type=int(request.params['stype']) / 100, ptype=0, description='', push_feed_flags=0, news_merge_type=0, mini_merge_type=0, update_time_on_merge=0, custom_expr=0, persist_body=0, persist_feeddb=0, lifetime=0, daily_quota=0, news_merge_by='', mini_merge_by='', source_by='', psource_by='', actor_by='', dispatch_expr='') print cfg.description return render( '/feed-config.mako', { "stype": cfg.stype, "type": cfg.type, "weight": cfg.weight, "desc": cfg.description.decode('utf-8'), "ptype": cfg.ptype, "save_content": cfg.is_persist_content, "save_feed_db": cfg.is_persist_feeddb, "news_merge_type": cfg.news_merge_type, "mini_merge_type": cfg.mini_merge_type, "push_flags": cfg.push_flag, "custom_expr": cfg.is_custom_expr, "update_time_on_merge": cfg.is_update_time, "lifetime": cfg.lifetime, "daily_quota": cfg.daily_quota })
def StypeConfigEdit(self): stype = -1 from_version_id = 0 apply_id = 0 uid = 0 if "id" in request.cookies: uid = int(request.cookies['id']) if "stype" in request.params: stype = int(request.params['stype']) if "apply_id" in request.params and "from_version_id" in request.params: apply_id = int(request.params['apply_id']) from_version_id = int(request.params['from_version_id']) return render( '/feed-config-edit.mako', { "stype": stype, "user_right": self.UserRight(request, response), "apply_id": apply_id, "from_version_id": from_version_id })
def FeedTplEdit(self): stype = -1 version = -1 tpl_id = -1 if "stype" in request.params: stype = int(request.params['stype']) if "version" in request.params: version = int(request.params['version']) if "tpl_id" in request.params: tpl_id = int(request.params['tpl_id']) ver = self.data_version_.filter_by(stype = stype, version = version).first() if not ver: return "参数错误" tpl_using = 0 if tpl_id > 0 and tpl_id == ver.using_tpl_id: tpl_using = 1 return render('/feed-tpl-edit.mako', {"stype" : stype, "version" : version, "tpl_id" : tpl_id, "tpl_using" : tpl_using, "user_right" : self.UserRight(request, response)})
def StypeConfigCreate(self): apply_id = 0 if "apply_id" in request.params: apply_id = int(request.params['apply_id']) return render('/feed-config-create.mako', {"apply_id" : apply_id})
def FeedListView(self): list_filter = 0 if "filter" in request.params: list_filter = int(request.params['filter']) return render('/feed-list.mako', {"user_right" : self.UserRight(request, response), "list_filter" : list_filter})
def ApplyNewFeed(self): return render('/apply-new-feed.mako')
def ApplyPublish(self): return render('/apply-publish.mako')
def ApplyNewTpl(self): return render('/apply-new-tpl.mako')
def StypeConfigCreate(self): apply_id = 0 if "apply_id" in request.params: apply_id = int(request.params['apply_id']) return render('/feed-config-create.mako', {"apply_id": apply_id})
def UserApply(self): return render('/user-apply.mako')
def ApplyRollback(self): return render('/apply-rollback.mako')
def ApplyNewVersion(self): return render('/apply-new-version.mako')
def UserApplyList(self): return render('/user-apply-list.mako')
def ApplyNewFeedList(self): return render('/apply-new-feed-list.mako')
def ApplyNewTplList(self): return render('/apply-new-tpl-list.mako')
def ApplyPublishList(self): return render('/apply-publish-list.mako')
def ApplyNewVersionList(self): return render('/apply-new-version-list.mako')
def ApplyRollbackList(self): return render('/apply-rollback-list.mako')