Select everything works as follows:
q = session.query(products)
Now I want to add a WHERE filter, so I'm trying:
q = session.query(products).filter_by(stock_count=0)
I get an error in which the nonetype object does not have the class_manager attribute.
Not sure what the problem is?
Update
The column seems to display correctly, how and when:
q = session.query(products)
for p in q:
print p.stock_count
It displays the value.
But if I do this:
p.stock_count = 6
I also get an error: "Unable to set attribute"
So I can query it, but adding a column as a filter, or setting the value causes an error.
Strange no?
source
share