Пример #1
0
 def getPaginationFilter(self, page):
     conf = (page.config.get('items_filters') or
             self.config.get('items_filters'))
     if conf == 'none' or conf == 'nil' or conf == '':
         conf = None
     if conf is not None:
         f = PaginationFilter(value_accessor=page_value_accessor)
         f.addClausesFromConfig(conf)
         return f
     return None
Пример #2
0
 def getPaginationFilter(self, page):
     conf = (page.config.get('items_filters')
             or self.config.get('items_filters'))
     if conf == 'none' or conf == 'nil' or conf == '':
         conf = None
     if conf is not None:
         f = PaginationFilter(value_accessor=page_value_accessor)
         f.addClausesFromConfig(conf)
         return f
     return None
Пример #3
0
class SettingFilterIterator:
    def __init__(self, it, fil_conf):
        self.it = it
        self.fil_conf = fil_conf
        self._fil = None

    def __iter__(self):
        if self._fil is None:
            self._fil = PaginationFilter()
            self._fil.addClausesFromConfig(self.fil_conf)

        for i in self.it:
            if self._fil.pageMatches(i):
                yield i
Пример #4
0
class SettingFilterIterator(object):
    def __init__(self, it, fil_conf, setting_accessor=None):
        self.it = it
        self.fil_conf = fil_conf
        self._fil = None
        self.setting_accessor = setting_accessor

    def __iter__(self):
        if self._fil is None:
            self._fil = PaginationFilter(value_accessor=self.setting_accessor)
            self._fil.addClausesFromConfig(self.fil_conf)

        for i in self.it:
            if self._fil.pageMatches(i):
                yield i
Пример #5
0
class SettingFilterIterator(object):
    def __init__(self, it, fil_conf, setting_accessor=None):
        self.it = it
        self.fil_conf = fil_conf
        self._fil = None
        self.setting_accessor = setting_accessor

    def __iter__(self):
        if self._fil is None:
            self._fil = PaginationFilter(value_accessor=self.setting_accessor)
            self._fil.addClausesFromConfig(self.fil_conf)

        for i in self.it:
            if self._fil.pageMatches(i):
                yield i