In [6]: ClassificationTask.query.update(values={'completed': True})
INFO     [sqlalchemy.engine.base.Engine] base.py:679 BEGIN (implicit)
INFO     [sqlalchemy.engine.base.Engine] base.py:1140 UPDATE schwartz_task 
SET completed=%(completed)s
INFO     [sqlalchemy.engine.base.Engine] base.py:1143 {'completed': True}
Out[6]: 71


In [7]: ClassificationTask.query.count()
INFO     [sqlalchemy.engine.base.Engine] base.py:1140 SELECT count(*) AS 
count_1
FROM (SELECT [...]
FROM schwartz_task
WHERE schwartz_task.task_type_id IN (%(task_type_id_1)s)) AS anon_1
INFO     [sqlalchemy.engine.base.Engine] base.py:1143 {'task_type_id_1': 10}
Out[7]: 14

If I have a polymorphic discriminator, it's automatically added as a 
constraint when doing a SELECT query. When I do an update query, it's not 
automatically added. This is surprising and dangerous. Is this a bug?


(semi-related 
thread: 
https://groups.google.com/forum/#!searchin/sqlalchemy/polymorphic_on$20join$20mischa%7Csort:date/sqlalchemy/U7RkHnM3R2U/332NjxnLAAAJ)

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to