[llvm-commits] [LNT] r167697 - /lnt/trunk/lnt/server/db/testsuitedb.py
Michael Gottesman
mgottesman at apple.com
Sun Nov 11 16:05:08 PST 2012
Author: mgottesman
Date: Sun Nov 11 18:05:07 2012
New Revision: 167697
URL: http://llvm.org/viewvc/llvm-project?rev=167697&view=rev
Log:
Figured out how to create the previous_order/next_order relations in SQLAlchemy for class Order. Removed FIXME and put in code.
Modified:
lnt/trunk/lnt/server/db/testsuitedb.py
Modified: lnt/trunk/lnt/server/db/testsuitedb.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/testsuitedb.py?rev=167697&r1=167696&r2=167697&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/testsuitedb.py (original)
+++ lnt/trunk/lnt/server/db/testsuitedb.py Sun Nov 11 18:05:07 2012
@@ -161,10 +161,14 @@
previous_order_id = Column("PreviousOrder", Integer, ForeignKey(
"%s.ID" % __tablename__))
- # FIXME: <sheepish> I would really like to have next_order and
- # previous_order relation's here, but can't figure out how to
- # declare them </sheepsih>.
-
+ # This will implicitly create the previous_order relation.
+ next_order = sqlalchemy.orm.relation("Order",
+ backref=sqlalchemy.orm.backref('previous_order',
+ uselist=False,
+ remote_side=id),
+ primaryjoin='Order.previous_order_id==Order.id',
+ uselist=False)
+
# Dynamically create fields for all of the test suite defined order
# fields.
class_dict = locals()
More information about the llvm-commits
mailing list