summaryrefslogtreecommitdiff
path: root/test/tables.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2005-09-17 06:49:56 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2005-09-17 06:49:56 +0000
commit69bdcfebcf1db133492217562d73e7ab9b800676 (patch)
treeab401b1233df35e6f1a2a03e073d6eab2c7d9a5b /test/tables.py
parent9acd3ab4529224aeda9219b80895b9d897ce6f25 (diff)
downloadsqlalchemy-69bdcfebcf1db133492217562d73e7ab9b800676.tar.gz
Diffstat (limited to 'test/tables.py')
-rw-r--r--test/tables.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/tables.py b/test/tables.py
index 9bf1c8acb..0c87d9da4 100644
--- a/test/tables.py
+++ b/test/tables.py
@@ -107,3 +107,39 @@ itemkeywords.insert().execute(
dict(keyword_id=4, item_id=3)
)
db.connection().commit()
+
+
+class User(object):
+ def __init__(self):
+ self.user_id = None
+ def __repr__(self):
+ return (
+"""
+objid: %d
+User ID: %s
+User Name: %s
+email address ?: %s
+Addresses: %s
+Orders: %s
+Open Orders %s
+Closed Orderss %s
+------------------
+""" % tuple([id(self), self.user_id, repr(self.user_name), repr(getattr(self, 'email_address', None))] + [repr(getattr(self, attr, None)) for attr in ('addresses', 'orders', 'open_orders', 'closed_orders')])
+)
+
+class Address(object):
+ def __repr__(self):
+ return "Address: " + repr(getattr(self, 'address_id', None)) + " " + repr(getattr(self, 'user_id', None)) + " " + repr(self.email_address)
+
+class Order(object):
+ def __repr__(self):
+ return "Order: " + repr(self.description) + " " + repr(self.isopen) + " " + repr(getattr(self, 'items', None))
+
+class Item(object):
+ def __repr__(self):
+ return "Item: " + repr(self.item_name) + " " +repr(getattr(self, 'keywords', None))
+
+class Keyword(object):
+ def __repr__(self):
+ return "Keyword: %s/%s" % (repr(getattr(self, 'keyword_id', None)),repr(self.name))
+