Commits

João Pedro Francese  committed b1a61d2

[v0.2.17] Fixing default_repr bug when displaying the unicode of instances without a PK

  • Participants
  • Parent commits 7884378

Comments (0)

Files changed (2)

File inoa/models/utils.py

 
     try:
         if extra_info:
-            return u"#%d: %s" % (obj.id, extra_info)
+            return u"#%d: %s" % (obj.pk or u"-", extra_info)
         else:
-            return u"%s #%d" % (obj._meta.verbose_name.capitalize(), int(obj.id))
+            return u"%s #%s" % (obj._meta.verbose_name.capitalize(), obj.pk or u"-")
     except:
         return repr(obj)
 
 
 setup(
     name='django-inoa',
-    version='0.2.16',
+    version='0.2.17',
     author='Inoa',
     author_email='django@inoa.com.br',
     packages=packages,