Skip to content

Instantly share code, notes, and snippets.

@infinite-Joy
Created June 14, 2017 09:14
Show Gist options
  • Save infinite-Joy/f4db9380a6402086b67bb3de2b3ca66b to your computer and use it in GitHub Desktop.
Save infinite-Joy/f4db9380a6402086b67bb3de2b3ca66b to your computer and use it in GitHub Desktop.
def transactions_filtered_in_python_code():
with profiled():
mysql_engine = create_engine('mysql://{0}:{1}@{2}/{3}'.format(user, pwd, host, db))
Session = sessionmaker(bind=mysql_engine)
session = Session()
transactions = session.query(Transactions).all()
return [(t.id, t.name, t.billing_type) for t in transactions if t.created_at == '2015-05-11' ]
transactions_filtered_in_python_code()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment