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


Python actor.Actor类代码示例

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


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

示例1: _msg_mapping

 def _msg_mapping(self):
     mapping = super(Reject, self)._msg_mapping
     change = self.response.get_change('responsible')
     if change:
         mapping['old_responsible'] = Actor.lookup(change.get('before')).get_link()
         mapping['new_responsible'] = Actor.lookup(change.get('after')).get_link()
     return mapping
开发者ID:4teamwork,项目名称:opengever.core,代码行数:7,代码来源:response_description.py

示例2: test_user_is_the_only_representatives_of_a_user

    def test_user_is_the_only_representatives_of_a_user(self):
        actor = Actor.lookup('jurgen.konig')
        self.assertEquals([self.get_ogds_user(self.secretariat_user)],
                          actor.representatives())

        actor = Actor.lookup(self.regular_user.getId())
        self.assertEquals([self.get_ogds_user(self.regular_user)],
                          actor.representatives())
开发者ID:lukasgraf,项目名称:opengever.core,代码行数:8,代码来源:test_actor_lookup.py

示例3: actor

    def actor(self):
        """Returns a formatted link to the actor that created this version.
        """
        if self.version == 0:
            # Always return document's original creator for initial version
            return Actor.user(self._context.Creator()).get_link()

        principal = self.sys_metadata['principal']
        actor = Actor.user(principal)
        return actor.get_link()
开发者ID:4teamwork,项目名称:opengever.core,代码行数:10,代码来源:versions_tab.py

示例4: msg

 def msg(self):
     change = self.response.get_change('responsible')
     responsible_new = Actor.lookup(change.get('after')).get_link()
     responsible_old = Actor.lookup(change.get('before')).get_link()
     return _('transition_msg_reassign',
              u'Reassigned from ${responsible_old} to '
              u'${responsible_new} by ${user}',
              mapping={'user': self.response.creator_link(),
                       'responsible_new': responsible_new,
                       'responsible_old': responsible_old})
开发者ID:,项目名称:,代码行数:10,代码来源:

示例5: setUp

    def setUp(self):
        super(TestResolveOGUIDView, self).setUp()

        self.group = create(Builder('ogds_group')
                            .having(groupid='group', users=[self.user]))
        self.user2 = create(Builder('ogds_user')
                            .in_group(self.group)
                            .having(userid='x.john.doe',
                                    lastname='Doe',
                                    firstname='John'))

        self.actor1 = Actor.user(self.user.userid)
        self.actor2 = Actor.user(self.user2.userid)
开发者ID:lukasgraf,项目名称:opengever.core,代码行数:13,代码来源:test_list_groupmembers.py

示例6: test_contact_has_no_representatives

    def test_contact_has_no_representatives(self):
        contact = create(Builder('contact')
                         .having(firstname=u'Paul')
                         .in_state('published'))

        actor = Actor.lookup('contact:{}'.format(contact.id))
        self.assertItemsEqual([], actor.representatives())
开发者ID:,项目名称:,代码行数:7,代码来源:

示例7: render_checked_out_link

    def render_checked_out_link(self):
        manager = queryMultiAdapter(
            (self.context, self.request), ICheckinCheckoutManager)

        if manager.get_checked_out_by():
            return Actor.user(manager.get_checked_out_by()).get_link()
        return ''
开发者ID:,项目名称:,代码行数:7,代码来源:

示例8: get_data_for_item

    def get_data_for_item(self, item):
        admin_unit = item.get_admin_unit().title
        task_type = task_type_helper(item, item.task_type)
        sequence_number = unicode(item.sequence_number).encode("utf-8")
        deadline = helper.readable_date(item, item.deadline)

        title = unicode(getattr(item, "Title", getattr(item, "title", ""))).encode("utf-8")

        issuer = get_issuer_of_task(item, with_client=True, with_principal=False)

        responsible_org_unit = item.get_assigned_org_unit()
        responsible = Actor.lookup(item.responsible)
        responsible_label = responsible_org_unit.prefix_label(responsible.get_label(with_principal=False))

        dossier_title = item.containing_dossier or ""

        reference = unicode(getattr(item, "reference", getattr(item, "reference_number", ""))).encode("utf-8")

        review_state = workflow_state(item, item.review_state)

        return [
            admin_unit,
            sequence_number,
            title,
            task_type,
            dossier_title,
            reference,
            issuer,
            responsible_label,
            deadline,
            review_state,
        ]
开发者ID:4teamwork,项目名称:opengever.core,代码行数:32,代码来源:tasklisting.py

示例9: test_document_report

    def test_document_report(self, browser):
        browser.login().open(view='document_report',
                             data={'paths:list': [
                                   '/'.join(self.document.getPhysicalPath()),
                                   ]})

        with NamedTemporaryFile(delete=False, suffix='.xlsx') as tmpfile:
            tmpfile.write(browser.contents)
            tmpfile.flush()
            workbook = load_workbook(tmpfile.name)

        self.assertSequenceEqual(
            [
             u'Client1 / 1 / 1',
             1L,
             u'Testdokum\xe4nt',
             u'Mustermann Max',
             get_localized_time(self.document_date),
             get_localized_time(self.receipt_date),
             get_localized_time(self.delivery_date),
             Actor.lookup(TEST_USER_ID).get_label(),
             u'unchecked',
             u'Dossier A',
             ],
            [cell.value for cell in workbook.active.rows[1]])
开发者ID:,项目名称:,代码行数:25,代码来源:

示例10: test_user_corresponds_to_current_user

    def test_user_corresponds_to_current_user(self):
        actor = Actor.lookup('jurgen.konig')

        self.assertTrue(
            actor.corresponds_to(self.get_ogds_user(self.secretariat_user)))
        self.assertFalse(
            actor.corresponds_to(self.get_ogds_user(self.regular_user)))
开发者ID:lukasgraf,项目名称:opengever.core,代码行数:7,代码来源:test_actor_lookup.py

示例11: plone_participations

    def plone_participations(self):
        if not self.context.has_participation_support():
            return []

        # get the participants
        phandler = IParticipationAware(self.context)
        results = list(phandler.get_participations())

        # also append the responsible
        class ResponsibleParticipant(object):
            pass

        responsible = ResponsibleParticipant()
        responsible.roles = _dossier(u'label_responsible', 'Responsible')
        responsible.role_list = responsible.roles

        dossier_adpt = IDossier(self.context)
        responsible.contact = dossier_adpt.responsible
        results.append(responsible)

        users = []
        for dossier in results:
            actor = Actor.lookup(dossier.contact)
            users.append({
                'Title': actor.get_label(),
                'getURL': actor.get_profile_url(),
                'css_class': 'function-user',
            })
        return users
开发者ID:4teamwork,项目名称:opengever.core,代码行数:29,代码来源:overview.py

示例12: get_responsible_label

    def get_responsible_label(self, linked=True):
        actor = Actor.lookup(self.responsible)
        org_unit = ogds_service().fetch_org_unit(self.assigned_org_unit)
        if not linked:
            return org_unit.prefix_label(actor.get_label())

        return org_unit.prefix_label(actor.get_link())
开发者ID:,项目名称:,代码行数:7,代码来源:

示例13: test_inbox_corresponds_to_all_inbox_assigned_users

    def test_inbox_corresponds_to_all_inbox_assigned_users(self):
        actor = Actor.lookup('inbox:fa')

        self.assertTrue(
            actor.corresponds_to(self.get_ogds_user(self.secretariat_user)))
        self.assertFalse(
            actor.corresponds_to(self.get_ogds_user(self.regular_user)))
开发者ID:lukasgraf,项目名称:opengever.core,代码行数:7,代码来源:test_actor_lookup.py

示例14: summary

 def summary(self):
     actor = Actor.lookup(self.context.Creator())
     msg = _('summary_disposition_added',
             u'New disposition added by ${user} on admin unit ${admin_unit}',
             mapping={'user': actor.get_label(with_principal=False),
                      'admin_unit': get_current_admin_unit().label()})
     return self.translate_to_all_languages(msg)
开发者ID:4teamwork,项目名称:opengever.core,代码行数:7,代码来源:activities.py

示例15: test_template_journal_tab

 def test_template_journal_tab(self, browser):
     browser.login().open(self.template, view=JOURNAL_TAB)
     journal_entries = browser.css('table.listing').first.dicts()
     self.assertEqual(Actor.lookup(TEST_USER_ID).get_label(),
                      journal_entries[0]['Changed by'])
     self.assertEqual('Document added: My Document',
                      journal_entries[0]['Title'])
开发者ID:,项目名称:,代码行数:7,代码来源:


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