def handle_filter_action( self, action, data ):
     self.request['SESSION']['getpaid.order.filter.creation_date'] = data.get('creation_date')
     if data.get('creation_date'):
         data['creation_date'] = self.date_search_map.get( data['creation_date'] )
     self.request['SESSION']['getpaid.order.filter.query'] = data
     if data.get('renewal_date'):
         data['renewal_date'] = self.renewals_search_map.get( data['renewal_date'] )
     self.filtered = True
     self.results = query.search( data )
Exemple #2
0
 def handle_filter_action(self, action, data):
     self.request['SESSION'][
         'getpaid.order.filter.creation_date'] = data.get('creation_date')
     if data.get('creation_date'):
         data['creation_date'] = self.date_search_map.get(
             data['creation_date'])
     self.request['SESSION']['getpaid.order.filter.query'] = data
     if data.get('renewal_date'):
         data['renewal_date'] = self.renewals_search_map.get(
             data['renewal_date'])
     self.filtered = True
     self.results = query.search(data)
    def update( self ):
        super(OrderSearchComponent, self).update()
        if not self.filtered:
            if self.request['SESSION'].has_key('getpaid.order.filter.query'):
                search_query = self.request['SESSION']['getpaid.order.filter.query']
                self.request.set('form.creation_date',
                                 self.request['SESSION']['getpaid.order.filter.creation_date'])
            else:
                search_query = {'creation_date' : datetime.timedelta(7) }
                self.request.set('form.creation_date', 'last 7 days')
            self.results = query.search(search_query)

        if self.results is None:
            self.results = []
Exemple #4
0
    def update(self):
        super(OrderSearchComponent, self).update()
        if not self.filtered:
            if self.request['SESSION'].has_key('getpaid.order.filter.query'):
                search_query = self.request['SESSION'][
                    'getpaid.order.filter.query']
                self.request.set(
                    'form.creation_date', self.request['SESSION']
                    ['getpaid.order.filter.creation_date'])
            else:
                search_query = {'creation_date': datetime.timedelta(7)}
                self.request.set('form.creation_date', 'last 7 days')
            self.results = query.search(search_query)

        if self.results is None:
            self.results = []