From f2d70799fd34d7d7adb7705a100853b229e0afb3 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Sun, 3 Apr 2011 21:00:58 +0300 Subject: [PATCH 1/1] Add __repr__ to mapped classes This makes string representations of lists, tuples, dicts, etc. with the DB objects make sense --- pokedex/db/tables.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 5670da9..55cd487 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -62,6 +62,9 @@ class TableSuperclass(object): def __str__(self): return unicode(self).encode('utf8') + def __repr__(self): + return unicode(self).encode('utf8') + mapped_classes = [] class TableMetaclass(DeclarativeMeta): def __init__(cls, name, bases, attrs): -- 2.7.4