cant reproduce.  heres a test case of the above which passes:

from sqlalchemy import *
meta = BoundMetaData('sqlite://', echo=True)
tests = Table('tests',meta,
    Column('id', Integer, primary_key=True),
    Column('foo', String(30))
)

tests_state = Table('tests_state',meta,
    Column('id', Integer, ForeignKey('tests.id'), primary_key=True),
    Column('count', Integer, default=0)
)
meta.create_all()

class TestState(object):
    pass

class Test(object):
    pass

testStateMapper = mapper(TestState, tests_state)
testMapper = mapper(
    Test, tests,
    properties={'state': relation(TestState, uselist=False)}
)

sess = create_session()
test = Test()
test.state = TestState()
sess.save(test)
sess.flush()
assert test.state.count == 0
sess.clear()

test = sess.get(Test, 1)
test.state.count = test.state.count + 1
sess.flush()

sess.clear()

test = sess.get(Test,1)
assert test.state.count == 1


--~--~---------~--~----~------------~-------~--~----~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to