Пример #1
0
    def _makeOne(self,
                 id,
                 since_field=None,
                 until_field=None,
                 caller=None,
                 extra=None,
                 precision_value=None):
        klass = self._getTargetClass()
        index = klass(id,
                      since_field,
                      until_field,
                      caller,
                      extra,
                      precision_value=precision_value)

        class DummyZCatalog(SimpleItem):
            id = 'DummyZCatalog'

        # Build pseudo catalog and REQUEST environment
        catalog = makerequest(DummyZCatalog())
        indexes = SimpleItem()

        indexes = indexes.__of__(catalog)
        index = index.__of__(indexes)

        return index
Пример #2
0
    def _makeOne(self, id='date'):
        index = self._getTargetClass()(id)
        class DummyZCatalog(SimpleItem):
            id = 'DummyZCatalog'

        # Build pseudo catalog and REQUEST environment
        catalog = makerequest(DummyZCatalog())
        indexes = SimpleItem()

        indexes = indexes.__of__(catalog)
        index = index.__of__(indexes)

        return index
Пример #3
0
    def _makeOne(self, *args, **kw):
        index = self._getTargetClass()(*args, **kw)

        class DummyZCatalog(SimpleItem):
            id = 'DummyZCatalog'

        # Build pseudo catalog and REQUEST environment
        catalog = makerequest(DummyZCatalog())
        indexes = SimpleItem()

        indexes = indexes.__of__(catalog)
        index = index.__of__(indexes)

        return index
Пример #4
0
    def _makeOne(self, id, extra=None):
        klass = self._getTargetClass()
        index = klass(id, extra=extra)

        class DummyZCatalog(SimpleItem):
            id = 'DummyZCatalog'

        # Build pseudo catalog and REQUEST environment
        catalog = makerequest(DummyZCatalog())
        indexes = SimpleItem()

        indexes = indexes.__of__(catalog)
        index = index.__of__(indexes)

        return index
Пример #5
0
    def _makeOne(self, id, since_field=None, until_field=None, caller=None,
                 extra=None):
        klass = self._getTargetClass()
        index = klass(id, since_field, until_field, caller, extra)

        class DummyZCatalog(SimpleItem):
            id = 'DummyZCatalog'

        # Build pseudo catalog and REQUEST environment
        catalog = makerequest(DummyZCatalog())
        indexes = SimpleItem()

        indexes = indexes.__of__(catalog)
        index = index.__of__(indexes)

        return index
Пример #6
0
    def _makeOne(self, id='date', precision=1):
        index = self._getTargetClass()(id)

        class DummyZCatalog(SimpleItem):
            id = 'DummyZCatalog'

        # Build pseudo catalog and REQUEST environment
        catalog = makerequest(DummyZCatalog())
        indexes = SimpleItem()

        indexes = indexes.__of__(catalog)
        index = index.__of__(indexes)

        if precision > 1:
            index.manage_changeProperties(precision=precision)

        return index