It took me some time to understand that you can't UPDATE a primary key using
the mapper. Is there a way to bypass this restriction? Am I understandig it
correctly? Is there a way to understand that some UPDATE where not
commmitted becouse of this restriction?

TIA
sandro


eng = create_engine("sqlite://", echo=False)

users = Table('users', eng,
       Column('user_name', String(30), nullable = False, primary_key = True),
       Column('user_last_name', String(30), nullable = False))

users.create()

users.insert().execute(
    {'user_name': 'Sam', 'user_last_name': 'Patts'},
    {'user_name': 'Sid', 'user_last_name': 'Watts'},

class User(object): pass

m = mapper(User, users)
u = m.select()[1]

eng.echo = True
        
u.user_name = 'Sandro'
objectstore.commit()



-- 
Sandro Dentella  *:-)
e-mail: [EMAIL PROTECTED] 
http://www.tksql.org                    TkSQL Home page - My GPL work


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to