I'm trying to do something that seems (to me at least) to be very
simple:  I have two classes, 'Project' and 'Image'.  I want to
associate a set of 'Image's with a project, like a slide show or
whatever.  I also want to use *one* of those images as a thumbnail for
the project.  Here's my relevant code:

class Project(DeclarativeBase):
        __tablename__='project'

        images = relation( Image, backref=backref('project'),
primaryjoin=id==Image.project_id, order_by=Image.sequencePosition )

        thumbnail_id = Column(Integer, ForeignKey('image.id') )
        thumbnail = relation(Image, primaryjoin=thumbnail_id==Image.id,
uselist=False)

class Image(DeclarativeBase):
        __tablename__='image'

        project_id = Column(Integer, ForeignKey('project.id'))


I've tried about 20 different ways to define these two types of
relationships, and every one of them ends up giving me circular
dependancy errors.

Can someone help me understand what's going wrong?
Thanks
-Ryan

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