Beispiel #1
0
    def update(self):
        ViewletBase.update(self)
        super(RCSESections, self).update()
        memberid = self.portal_state.member().getId()
        favmanager = self.context.restrictedTraverse(VIEW_NAME)
        catalog = getToolByName(self.context, 'portal_catalog')

        query = {
            "portal_type": "collective.rcse.group",
            "sort_on": "sortable_title",
            "sort_limit": 5
        }
        self.favorites = [
            f for f in favmanager.get(query=query) if f.Creator != memberid
        ]
        #        query = {"portal_type": "collective.rcse.group",
        #                 "sort_on": "sortable_title",
        #                 "sort_limit": 5,
        #                 "group_watchers": memberid}
        #        self.watched = catalog(**query)

        query = {
            "portal_type": "collective.rcse.group",
            "sort_on": "sortable_title",
            "user_with_local_roles": memberid
        }
        self.registred = [r for r in catalog(**query) if r.Creator != memberid]

        query = {
            "portal_type": "collective.rcse.group",
            "sort_on": "sortable_title",
            "Creator": memberid
        }
        self.my_groups = catalog(**query)
Beispiel #2
0
 def test_update(self):
     request = self.app.REQUEST
     self.setRoles(['Manager', 'Member'])
     self.portal.invokeFactory('Folder', 'f1')
     context = getattr(self.portal, 'f1')
     alsoProvides(context, INavigationRoot)
     viewlet = ViewletBase(context, request, None, None)
     viewlet.update()
     self.assertEqual(viewlet.site_url, "http://nohost/plone")
     self.assertEqual(viewlet.navigation_root_url, "http://nohost/plone/f1")
Beispiel #3
0
 def test_update(self):
     request = self.app.REQUEST
     self.setRoles(['Manager', 'Member'])
     self.portal.invokeFactory('Folder', 'f1')
     context = getattr(self.portal, 'f1')
     alsoProvides(context, INavigationRoot)
     viewlet = ViewletBase(context, request, None, None)
     viewlet.update()
     self.assertEqual(viewlet.site_url, "http://nohost/plone")
     self.assertEqual(viewlet.navigation_root_url, "http://nohost/plone/f1")
Beispiel #4
0
    def update(self):
        ViewletBase.update(self)
        if not hasattr(self, 'registry'):
            self.registry = component.getUtility(IRegistry)

        buttons = list(component.getAdapters((self.context, self.request),
                                             IButton))
        settings = self.registry.forInterface(Settings)

        if settings and settings.buttons:
            self.buttons = [button for name, button in buttons\
                            if name in settings.buttons]
        else:
            self.buttons = [button for name, button in buttons]

        self.buttons.sort(cmp=cmp_button)
 def update(self):
     self._update()
     ViewletBase.update(self)
Beispiel #6
0
 def update(self):
     ViewletBase.update(self)
     self.product_view = getMultiAdapter((self.context, self.request), name=u'view')
Beispiel #7
0
 def update(self):
     """override to disable form processing
     """
     return ViewletBase.update(self)
Beispiel #8
0
 def update(self):
     self._update()
     ViewletBase.update(self)