From: Arnaud F. <ar...@an...> - 2006-08-20 13:57:21
|
Hello, I have the following tables: class Package(SQLObject): name = StringCol(alternateID=True, length=255) [...] class TrackerPackage(SQLObject): [...] info = ForeignKey('Package') tracker = ForeignKey('Tracker') bugs = RelatedJoin('Bug') class Bug(SQLObject): [...] packages = RelatedJoin('TrackerPackage') status = RelatedJoin('BugStatus') class BugStatus(SQLObject): name = StringCol(alternateID=True, length=40) bugs = RelatedJoin('Bug') class Tracker(SQLObject): [...] packages = MultipleJoin('TrackerPackage') flags = MultipleJoin('CustomFlagDefinition') At the moment, i'm doing something like that : tracker.get(1) for package in tracker.packages: print package.info.name [...] for bug in package.bugs: print bug.bugNumber for status in bug.status: print status.name I wonder if there is a way to do a *JOIN* or someting else for avoiding too much SQL requests. I can't figure out how i could do that with sqlobject. Regards, Arnaud Fontaine |