Example #1
0
    def retrieve_cache(self, correlation_key):
        correlations = []
        params = {'key': correlation_key}

        if self.start:
            params['start'] = {'$gte': start}

        if self.end:
            params['end'] = {'$lte': self.end}

        #cache = [row for row in Correlation.get_collection().find(params
        #    ).sort('start', pymongo.ASCENDING)]

        cache = Correlation.get_collection().find(params).sort(
            'start', pymongo.ASCENDING)

        for row in cache:
            correlations.append(Correlation(**row))

        return correlations
 def retrieve_cache(self, correlation_key):
     correlations = []
     params = {'key': correlation_key}
     
     if self.start:
         params['start'] = {'$gte': start}
     
     if self.end:
         params['end'] = {'$lte': self.end}
             
     #cache = [row for row in Correlation.get_collection().find(params
     #    ).sort('start', pymongo.ASCENDING)]
         
     
     cache = Correlation.get_collection().find(params
         ).sort('start', pymongo.ASCENDING)
     
     for row in cache:
         correlations.append(Correlation(**row))
     
     return correlations