Hello.
I'v get this error while add new record to Service table.

    "many-to-many relation, 'secondaryjoin' is needed as well." %
(self))
sqlalchemy.exc.ArgumentError: Could not determine join condition
between parent/child tables on relation Service.services.  Specify a
'primaryjoin' expression.  If this is a many-to-many relation,
'secondaryjoin' is needed as well.



services_table = Table('service', metadata,
    Column('id', types.Integer, primary_key=True, autoincrement=True),
    Column('table', types.Unicode(10)), # a or b
    Column('name', types.Unicode(255), nullable=False),
    Column('code', types.Integer),
)

service_btype_table = Table('service_btype', metadata,
    Column('service_b_id', types.Integer, ForeignKey('service.id'),
primary_key=True),
    Column('service_a_id', types.Integer, ForeignKey('service.id'),
primary_key=True)
)

mapper(Service, services_table,
        properties={'services': relation(Service, backref='services',
                              secondary=service_btype_table)})

Whats wrong in code?

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to