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


Python settings.EventSettingPrincipal类代码示例

本文整理汇总了Python中indico.modules.events.models.settings.EventSettingPrincipal的典型用法代码示例。如果您正苦于以下问题:Python EventSettingPrincipal类的具体用法?Python EventSettingPrincipal怎么用?Python EventSettingPrincipal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: migrate_legacy_events

    def migrate_legacy_events(self):
        print cformat('%{white!}migrating legacy events')

        # XXX: removed display manager / internal page manager update
        # don't forget to handle them when updating this for 2.0!
        wfr = WebFactoryRegistry()._getConfRegistry()
        for event in self._committing_iterator(self._get_events()):
            if not hasattr(event, '_old_id'):
                new_id = self.gen_event_id()
                event.unindexConf()
                del self.zodb_root['conferences'][event.id]
                wf = wfr.pop(event.id, None)
                event._old_id = event.id
                event.id = new_id
                if wf is not None:
                    wfr[event.id] = wf
                self.zodb_root['conferences'][event.id] = event
                event.indexConf()
                EventSetting.find(event_id=event._old_id).update({EventSetting.event_id: event.id})
                EventSettingPrincipal.find(event_id=event._old_id).update({EventSettingPrincipal.event_id: event.id})
                db.session.add(LegacyEventMapping(legacy_event_id=event._old_id, event_id=int(event.id)))
                if not self.quiet:
                    self.print_success(cformat('%{cyan}{}').format(event.id), event_id=event._old_id)
            else:
                # happens if this importer was executed before but you want to add the mapping to your DB again
                db.session.add(LegacyEventMapping(legacy_event_id=event._old_id, event_id=int(event.id)))
                if not self.quiet:
                    self.print_success(cformat('%{cyan}{}%{reset} %{yellow}(already updated in zodb)').format(event.id),
                                       event_id=event._old_id)
开发者ID:belokop,项目名称:indico_bare,代码行数:29,代码来源:legacy_events.py

示例2: delete_all

    def delete_all(self, event):
        """Deletes all settings.

        :param event: Event (or its ID)
        """
        EventSetting.delete_all(self.module, event_id=event)
        EventSettingPrincipal.delete_all(self.module, event_id=event)
        self._flush_cache()
开发者ID:k3njiy,项目名称:indico,代码行数:8,代码来源:settings.py

示例3: remove_principal

    def remove_principal(self, event, name, principal):
        """Removes a principal from an ACL

        :param event: Event (or its ID)
        :param name: Setting name
        :param principal: A :class:`.User` or a :class:`.GroupProxy`
        """
        self._check_name(name)
        EventSettingPrincipal.remove_principal(self.module, name, principal, event_id=event)
        self._flush_cache()
开发者ID:k3njiy,项目名称:indico,代码行数:10,代码来源:settings.py

示例4: set

    def set(self, event, name, acl):
        """Replaces an ACL with a new one

        :param event: Event (or its ID)
        :param name: Setting name
        :param acl: A set containing principals (users/groups)
        """
        self._check_name(name)
        EventSettingPrincipal.set_acl(self.module, name, acl, event_id=event)
        self._flush_cache()
开发者ID:k3njiy,项目名称:indico,代码行数:10,代码来源:settings.py

示例5: delete

    def delete(self, event, *names):
        """Deletes settings.

        :param event: Event (or its ID)
        :param names: One or more names of settings to delete
        """
        self._split_call(names,
                         lambda name: EventSetting.delete(self.module, *name, event_id=event),
                         lambda name: EventSettingPrincipal.delete(self.module, *name, event_id=event))
        self._flush_cache()
开发者ID:k3njiy,项目名称:indico,代码行数:10,代码来源:settings.py

示例6: set_multi

    def set_multi(self, event, items):
        """Sets multiple settings at once.

        :param event: Event (or its ID)
        :param items: Dict containing the new settings
        """
        self._split_call(items,
                         lambda x: EventSetting.set_multi(self.module, x, event_id=event),
                         lambda x: EventSettingPrincipal.set_acl_multi(self.module, x, event_id=event))
        self._flush_cache()
开发者ID:k3njiy,项目名称:indico,代码行数:10,代码来源:settings.py

示例7: set_multi

    def set_multi(self, event, items):
        """Sets multiple settings at once.

        :param event: Event (or its ID)
        :param items: Dict containing the new settings
        """
        items = {k: self._convert_from_python(k, v) for k, v in items.iteritems()}
        self._split_call(items,
                         lambda x: EventSetting.set_multi(self.module, x, event_id=event),
                         lambda x: EventSettingPrincipal.set_acl_multi(self.module, x, event_id=event))
        self._flush_cache()
开发者ID:bkolobara,项目名称:indico,代码行数:11,代码来源:settings.py

示例8: migrate_legacy_events

    def migrate_legacy_events(self):
        print cformat('%{white!}migrating legacy events')

        dmr = ConfDisplayMgrRegistery()._getDisplayMgrRegistery()
        wfr = WebFactoryRegistry()._getConfRegistry()
        ipmr = InternalPagesMgrRegistery()._getInternalPagesMgrRegistery()
        for event in self._committing_iterator(self._get_events()):
            if not hasattr(event, '_old_id'):
                new_id = self.gen_event_id()
                event.unindexConf()
                del self.zodb_root['conferences'][event.id]
                dm = dmr.pop(event.id, None)
                wf = wfr.pop(event.id, None)
                ipm = ipmr.pop(event.id, None)
                event._old_id = event.id
                event.id = new_id
                if dm is not None:
                    dmr[event.id] = dm
                if wf is not None:
                    wfr[event.id] = wf
                if ipm is not None:
                    ipmr[event.id] = ipm
                self.zodb_root['conferences'][event.id] = event
                event.indexConf()
                IndexedEvent.find(id=event._old_id).update({IndexedEvent.id: event.id})
                EventSetting.find(event_id=event._old_id).update({EventSetting.event_id: event.id})
                EventSettingPrincipal.find(event_id=event._old_id).update({EventSettingPrincipal.event_id: event.id})
                db.session.add(LegacyEventMapping(legacy_event_id=event._old_id, event_id=int(event.id)))
                print cformat('%{green}+++%{reset} '
                              '%{white!}{:6s}%{reset} %{cyan}{}').format(event._old_id, int(event.id))
            else:
                # happens if this importer was executed before but you want to add the mapping to your DB again
                db.session.add(LegacyEventMapping(legacy_event_id=event._old_id, event_id=int(event.id)))
                msg = cformat('%{green}+++%{reset} '
                              '%{white!}{:6s}%{reset} %{cyan}{}%{reset} %{yellow}(already updated in zodb)')
                print msg.format(event._old_id, int(event.id))
开发者ID:k3njiy,项目名称:indico,代码行数:36,代码来源:legacy_events.py

示例9: merge_users

 def merge_users(self, target, source):
     """Replaces all ACL user entries for `source` with `target`"""
     EventSettingPrincipal.merge_users(self.module, target, source)
     self._flush_cache()
开发者ID:k3njiy,项目名称:indico,代码行数:4,代码来源:settings.py

示例10: _event_deleted

def _event_deleted(event, **kwargs):
    EventSetting.delete_event(event.id)
    EventSettingPrincipal.delete_event(event.id)
开发者ID:dbourillot,项目名称:indico,代码行数:3,代码来源:__init__.py


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