Is there a more efficient way to do the following? I am more interested in knowing if there is a way to set "mylist" to match anything if day is equal to 'all' because in other scenarios, "mylist" can contain a lot more elements.
if day == 'all':
mylist = ['monday','tuesday','wednesday','thursday','friday','saturday','sunday']
else:
mylist = [day] # day equal to one of the above
records = meta.Session.query(Transaction).filter(Transaction.day.in_(mylist)).all()