MD500_Pilot

Untitled

Apr 13th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. This does not, although looking at the error it seems to be doing the right thing:
  2. day_of_week = 'monday'
  3. conn.execute(scheduled_jobs.update().where(and_(scheduled_jobs.c.zone == (zone_name),
  4. scheduled_jobs.c.zone_job == (zone_job))).values({f'scheduled_jobs.c.{day_of_week}': False}))
  5.  
  6. Trace:
  7. File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/sql/crud.py", line 179, in _get_crud_params
  8. % (", ".join("%s" % c for c in check))
  9. sqlalchemy.exc.CompileError: Unconsumed column names: scheduled_jobs.c.monday
  10.  
  11. Nor does this work, and the trace is identical:
  12. day_of_week = 'monday'
  13. c_statement = f'scheduled_jobs.c.{day_of_week}'
  14. conn.execute(scheduled_jobs.update().where(and_(scheduled_jobs.c.zone == (zone_name),
  15. scheduled_jobs.c.zone_job == (zone_job))).values({c_statement': False}))
  16.  
  17.  
  18. Trace:
  19. File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/sql/crud.py", line 179, in _get_crud_params
  20. % (", ".join("%s" % c for c in check))
  21. sqlalchemy.exc.CompileError: Unconsumed column names: scheduled_jobs.c.monday
Add Comment
Please, Sign In to add comment