Hi,
These days i'm playing with sqlalchemy to know if it can fit my
needs... I'm having some troubles with this ( maybe it's a real dumb
question.. or maybe a non supported feature.. :) ):
I have a database (mssql) with some tables with composite primary
keys... something like this:
t_jobs = sa.Table('jobs', metadata,
sa.Column('identifier', sa.VARCHAR(20)),#,
primary_key=True),
sa.Column('job_batch',
sa.databases.mssql.MSUniqueIdentifier),
sa.Column("start",_sql.MSDateTime_pyodbc),#, primary_key=True),
sa.Column("stop",_sql.MSDateTime_pyodbc),
sa.Column("station", sa.VARCHAR(20)),
sa.PrimaryKeyConstraint('identifier', 'inizio'),
autoload=True)
and it's mapped to a class... like this:
class Job(object):
...
sa.orm.mapper(Job, t_jobs)
When i create and save a j = Job(identifier, start), I have no
problems and it saves the new record on the table, but when i want to
update ( update or save_or_update ) the record with the stop time i
just don't update the record... It does not throw any new
exception.... I've also tryied to change the table definition putting
the primary_key on both columns definition instead of using
PrimaryKeyConstraint ( as you can see by the comments.. ) but the
result is the same...
Am I missing something? Or maybe composite primary keys tables are not
supported for updating using the session.... ?
Thanks,
Fabio
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---