I got a result list and want to keep the elements that are newer than timeline and older than bookmark. Is there a more convenient method than iterating the whole list and removing the elements if they match the conditition? Can you introduce me to how specically how? The way I fetch data and then sort it
results = A.all().search(self.request.get('q')).filter("published =", True)
results = sorted(results, key=lambda x: x.modified, reverse=True)
Then I want to keep elements older than bookmark and newer than timeline where these variables are defined by HTTP GET or if blank defined as
bookmark = datetime.now()
timeline = datetime.now () - timedelta (days = 50)
I hope you understand what I'm trying to do (it's like paging) and thank you in advance for any ideas.