diff --git svarga models base py svarga models base py --- svarga mode

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/svarga/models/base.py b/svarga/models/base.py
--- a/svarga/models/base.py
+++ b/svarga/models/base.py
@@ -79,11 +79,7 @@ class SvargaDeclarativeMeta(DeclarativeM
result = DeclarativeMeta.__init__(cls, classname, bases, dict_)
# Create model manager
- manager = getattr(cls, '__manager__', None)
-
- if manager is None:
- manager = ModelManager
-
+ manager = getattr(cls, '__manager__', ModelManager)
cls.objects = manager(cls)
return result
@@ -106,3 +102,11 @@ def factory(table_prefix=None):
setattr(base, TABLE_PREFIX_ATTRIBUTE, table_prefix)
return base
+
+
+ def __repr__(self):
+ try:
+ u = unicode(self)
+ except (UnicodeEncodeError, UnicodeDecodeError):
+ u = '[Bad Unicode data]'
+ return smart_str(u'<%s: %s>' % (self.__class__.__name__, u))