Hello,

I am trying to use sqlalchemy with oracle, here is my code:

from sqlalchemy import *
from sqlalchemy.orm import sessionmaker, mapper, relationship
class Activite(object):
    pass
class Famprod(object):
    pass
engine = create_engine('oracle://login/paswd@db', echo=True)
metadata = MetaData(engine)
tActivite = Table('ACTIVITE', metadata,
                  autoload=True)
mapper(Activite, tActivite)
tFamprod = Table('FAMPROD', metadata,
                 autoload=True)
mapper(Famprod, tFamprod)
Famprod.activite = relationship(Activite)
Session = sessionmaker(bind=engine)
session = Session()
famprod = session.query(Famprod).get(("ED", "15"))
print famprod.activite


and i get this error:
AttributeError: 'RelationshipProperty' object has no attribute
'parent'

The table famprod has a composite key, one of the key columns is the
key of activite.
Is there something wrong with my code ?
I have tried to manually define the tFamprod's keys and foreign key
without succes.

Thank you.

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