From: Petr Viktorin Date: Sun, 3 Apr 2011 18:00:58 +0000 (+0300) Subject: Add __repr__ to mapped classes X-Git-Tag: veekun-promotions/2011041101~8^2~3 X-Git-Url: http://git.veekun.com/zzz-pokedex.git/commitdiff_plain/f2d70799fd34d7d7adb7705a100853b229e0afb3 Add __repr__ to mapped classes This makes string representations of lists, tuples, dicts, etc. with the DB objects make sense --- 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):