On Mar 16, 2011, at 4:09 PM, writeson wrote:

> Michael,
> 
>> 
>> there's nothing obviously wrong with the above other than the unusual naming 
>> scheme of "Col", "Int", and "FK".     Two steps to take are to assert that 
>> the object is dirty, "assert item in session.dirty", and the attribute has a 
>> change,  "from sqlalchemy.orm import attributes; assert 
>> attributes.get_history(item, 'qty').has_changes()", before flush() or 
>> commit() is called.
>> 
> 
> Thanks for the quick reply. I'm not sure what you mean by the unusual
> naming scheme of "Col", "Int" and "FK", aren't those the correct
> syntax right out of the SqlAlchemy documentation? In case this helps,
> I'm using SqlAlchemy as it's delivered by Pylons 0.9.6.

erm no those aren't the names in the docs, heres Column, Integer, ForeignKey:

http://www.sqlalchemy.org/docs/core/schema.html#sqlalchemy.schema.Column
http://www.sqlalchemy.org/docs/core/schema.html#sqlalchemy.schema.ForeignKey
http://www.sqlalchemy.org/docs/core/types.html#sqlalchemy.types.Integer


> 
> Anyway, I inserted the code you recommended and it is in fact throwing
> an assertion error that there have been no changes to the item object.
> I guess my next question is why isn't the item.qty = 10 code causing a
> change in the item object?

I couldn't tell you without some more concrete details, a short test case would 
be best.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to