Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. recent_oa = db_session.query(exists().where(
  2. and_(
  3. and_(Jobs.candidate_id == candidate_id, Jobs.interview_type == 'EVALUATION', Jobs.disposition_date < datetime.now()-timedelta(days=1)),
  4. ## I want this to evaluate to be True
  5. and_(~Jobs.candidate_id == candidate_id, Jobs.interview_type == 'IN_HOUSE', Jobs.disposition_date > '2017-01-01'),
  6. ## and I want this to evaluate to False
  7. )
  8. )).scalar()
  9.  
  10. recent_oa
  11. >> True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement