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


Python CategoryManager.getId方法代码示例

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


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

示例1: _process_PUT

# 需要导入模块: from MaKaC.conference import CategoryManager [as 别名]
# 或者: from MaKaC.conference.CategoryManager import getId [as 别名]
 def _process_PUT(self):
     category = CategoryManager().getById(request.view_args['category_id'])
     if category not in self.user.favorite_categories:
         if not category.canAccess(AccessWrapper(self.user.as_avatar)):
             raise Forbidden()
         self.user.favorite_categories.add(category)
         if redis_write_client:
             suggestions.unignore(self.user, 'category', category.getId())
             suggestions.unsuggest(self.user, 'category', category.getId())
     return jsonify(success=True)
开发者ID:k3njiy,项目名称:indico,代码行数:12,代码来源:controllers.py

示例2: _process_DELETE

# 需要导入模块: from MaKaC.conference import CategoryManager [as 别名]
# 或者: from MaKaC.conference.CategoryManager import getId [as 别名]
 def _process_DELETE(self):
     category = CategoryManager().getById(request.view_args['category_id'])
     if category in self.user.favorite_categories:
         self.user.favorite_categories.remove(category)
         if redis_write_client:
             suggestions.unsuggest(self.user, 'category', category.getId())
     return jsonify(success=True)
开发者ID:k3njiy,项目名称:indico,代码行数:9,代码来源:controllers.py

示例3: get_excluded_categories

# 需要导入模块: from MaKaC.conference import CategoryManager [as 别名]
# 或者: from MaKaC.conference.CategoryManager import getId [as 别名]
def get_excluded_categories():
    """Get all excluded category IDs"""
    from indico_livesync.plugin import LiveSyncPlugin
    todo = {x['id'] for x in LiveSyncPlugin.settings.get('excluded_categories')}
    excluded = set()
    while todo:
        category_id = todo.pop()
        try:
            category = CategoryManager().getById(category_id)
        except KeyError:
            continue
        excluded.add(category.getId())
        todo.update(category.subcategories)
    return excluded
开发者ID:florv,项目名称:indico-plugins,代码行数:16,代码来源:util.py

示例4: changeCatStyle

# 需要导入模块: from MaKaC.conference import CategoryManager [as 别名]
# 或者: from MaKaC.conference.CategoryManager import getId [as 别名]
## You should have received a copy of the GNU General Public License
## along with Indico;if not, see <http://www.gnu.org/licenses/>.

from indico.core.db import DBMgr
from MaKaC.webinterface import displayMgr
from MaKaC.conference import CategoryManager

logfile=open('./oldstyles','w')
def changeCatStyle(cat):
    for subcat in cat.getSubCategoryList():
        currentStyle=subcat.getDefaultStyle("meeting")
        subcat.setDefaultStyle("meeting", "lhcb_meeting")
        logfile.write("cat %s: %s"%(subcat.getId(), currentStyle))
        changeCatStyle(subcat)
    for conf in cat.getConferenceList():
        currentStyle=displayMgr.ConfDisplayMgrRegistery().getDisplayMgr(conf).getDefaultStyle()
        displayMgr.ConfDisplayMgrRegistery().getDisplayMgr(conf).setDefaultStyle("lhcb_meeting")
        logfile.write("\t\t\tconf %s: %s"%(conf.getId(), currentStyle))


dbm = DBMgr.getInstance()
dbm.startRequest()
cat=CategoryManager().getById('233')
currentStyle=cat.getDefaultStyle("meeting")
cat.setDefaultStyle("meeting", "lhcb_meeting")
logfile.write("cat %s: %s"%(cat.getId(), currentStyle))
changeCatStyle(cat)

dbm.endRequest()

开发者ID:ferhatelmas,项目名称:indico,代码行数:31,代码来源:changeStyle.py


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