Hi! Sorry for the delay. I found out, why I wasn't able to reproduce it so easily. The rum reflection works quite unnaturally at the moment for these tables and relates them differently, than I would do by hand. Nevertheless, the problem still exists and here is minimized version of it
By the way, the code refers to some db reflection. I put a small demo dump of the postgresql database here: http://www.mfo.de/organisation/institute/brickenstein/ormsmin.sql And here is the code: from sqlalchemy import * from sqlalchemy.orm import * engine = create_engine('postgres:///ormsmin', echo=True) DBSession = scoped_session(sessionmaker(bind=engine)) metadata = MetaData(engine) mapper=DBSession.mapper project_table=Table("project",metadata,autoload=True) programming_language_table=Table("programming_language",metadata,autoload=True) project_programming_language_table=Table("project_programming_language",metadata,autoload=True) class ProgrammingLanguage(object): pass class Project(object): pass class ProjectProgrammingLanguage(object): pass mapper(ProjectProgrammingLanguage,project_programming_language_table) mapper(ProgrammingLanguage,programming_language_table,properties={ 'id' : programming_language_table.c.programming_language_id, 'order': programming_language_table.c.display_order, 'name': programming_language_table.c.name, 'project_languages':relation(ProjectProgrammingLanguage,backref="languages") }) mapper(Project, project_table, properties={ 'project_languages': relation(ProjectProgrammingLanguage, order_by=ProgrammingLanguage.order,backref="projects")}) language_id=1 lang = ProgrammingLanguage.query.get(language_id) DBSession.delete(lang) DBSession.flush() DBSession.commit() Thanks in advance, Michael --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
