The Query.join() documentations says:
    def join(self, prop, id=None, aliased=False, from_joinpoint=False)
    'prop' may be one of:
            * a class-mapped attribute, i.e. Houses.rooms

What exactly counts as class-mapped? I've set up a ForeignKey in my
Files table as well as a backref relation in my Projects table, but
none of these work:

print session.query(File).join(Project).filter_by(project='mario',
tapeout='sa11').one()
print
session.query(File).join(Project.files).filter_by(project='mario',
tapeout='sa11').one()
print session.query(File).join(Project.id).filter_by(project='mario',
tapeout='sa11').one()
print
session.query(File).join(File.project).filter_by(project='mario',
tapeout='sa11').one()
print
session.query(File).join(File.project_id).filter_by(project='mario',
tapeout='sa11').one()

They all fail with:
sqlalchemy.exceptions.InvalidRequestError: Mapper 'Mapper|File|files'
has no property '<sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x2a9a283650>'

It seems like .join(Project) should 'just work' after the information
I put in the sytem, but I don't know much...

If there's some documentation that makes this clear, feel free to just
link it.
If you want more code, let me know what to copy/paste.

Thanks!
--Buck

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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