Select all works like this:
q = session.query(products)
Now I want to add a WHERE filter, so I am trying:
q = session.query(products).filter_by(stock_count=0)
I get an error saying 'nonetype' object has no attribute 'class_manager'.
Not sure what the issue is?
Update The column seems to be mapped fine, as when I do:
q = session.query(products)
for p in q:
print p.stock_count
It outputs the value.
But if I do:
p.stock_count = 6
I get an error also, saying: "can't set attribute"
So I can query for it, but adding the column as a filter, OR setting the value causes an error.
Strange no?