コード例 #1
0
    def test_galery_type(self):
        galleries = getAllGalleryTypes()
        factory = collective.ptg.contentleadimage.adapters.ContentLeadImageAdapter
        self.assertTrue(factory in getAllGalleryTypes())

        adapter = getMultiAdapter(
                (self.get_gallery(), TestRequest()),
                name=named_adapter_prefix + 'contentleadimage'
        )
        self.failUnless(isinstance(adapter, factory))
コード例 #2
0
    def test_gallerytypes_registered(self):
        gallerytypes = getAllGalleryTypes()

        for t in gallerytypes:
            adapter = getMultiAdapter((self.gallery, self.request),
                                      name=named_adapter_prefix + t.name)
            self.failUnless(isinstance(adapter, t))
コード例 #3
0
    def test_gallerytypes_registered(self):
        gallerytypes = getAllGalleryTypes()

        for t in gallerytypes:
            adapter = getMultiAdapter((self.gallery, self.request),
                                      name=named_adapter_prefix + t.name)
            self.assertTrue(isinstance(adapter, t))
コード例 #4
0
    def update(self):
        gallerytypes = getAllGalleryTypes()
        displaytypes = getAllDisplayTypes()
        for t in gallerytypes:
            if len(t.schema.names()) > 0:
                self.add_fields_to_group(t, t.name)

        for t in displaytypes:
            if len(t.schema.names()) > 0:
                self.add_fields_to_group(t, t.name)

        super(GallerySettingsForm, self).update()
コード例 #5
0
ファイル: settings.py プロジェクト: Vinsurya/Plone
    def update(self):
        gallerytypes = getAllGalleryTypes()
        displaytypes = getAllDisplayTypes()
        for t in gallerytypes:
            if len(t.schema.names()) > 0:
                self.add_fields_to_group(t, t.name)

        for t in displaytypes:
            if len(t.schema.names()) > 0:
                self.add_fields_to_group(t, t.name)

        super(GallerySettingsForm, self).update()