def get_transactions(self,from_date=None,to_date=None,only_new=True):
"""
Retrieve transactions for producing text file
"""
query = {}
if only_new:
query['plaid2text.pulled_to_file'] = False
if from_date and to_date and (from_date < to_date):
query['date'] = {'$gte':from_date,'$lte':to_date}
elif from_date and not to_date:
query['date'] = {'$gte':from_date}
elif not from_date and to_date:
query['date'] = {'$lte':to_date}
transactions = self.account.find(query).sort('date',ASCENDING)
return transactions
评论列表
文章目录