Guest User

Untitled

a guest
Nov 23rd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. query = meta.Session.query(Campaign.merchant_id, sa.func.count(Campaign)).group_by(Campaign.merchant_id)
  2. one_day_before = datetime.today() - timedelta(days=1)
  3. query = query.filter(Campaign.last_change_date > one_day_before)
  4. print query
  5. results = query.all()
Add Comment
Please, Sign In to add comment