Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This does not, although looking at the error it seems to be doing the right thing:
- day_of_week = 'monday'
- conn.execute(scheduled_jobs.update().where(and_(scheduled_jobs.c.zone == (zone_name),
- scheduled_jobs.c.zone_job == (zone_job))).values({f'scheduled_jobs.c.{day_of_week}': False}))
- Trace:
- File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/sql/crud.py", line 179, in _get_crud_params
- % (", ".join("%s" % c for c in check))
- sqlalchemy.exc.CompileError: Unconsumed column names: scheduled_jobs.c.monday
- Nor does this work, and the trace is identical:
- day_of_week = 'monday'
- c_statement = f'scheduled_jobs.c.{day_of_week}'
- conn.execute(scheduled_jobs.update().where(and_(scheduled_jobs.c.zone == (zone_name),
- scheduled_jobs.c.zone_job == (zone_job))).values({c_statement': False}))
- Trace:
- File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/sql/crud.py", line 179, in _get_crud_params
- % (", ".join("%s" % c for c in check))
- sqlalchemy.exc.CompileError: Unconsumed column names: scheduled_jobs.c.monday
Add Comment
Please, Sign In to add comment