return u"%s #%d" % (obj._meta.verbose_name.capitalize(), obj.id)
setattr(models.Model, '__unicode__', default_repr)
- """Returns an instance (non-saved) of obj's model with the same attributes as obj."""
+ Returns a new instance of obj's model, with the same attributes as obj.
+ The new instance will not have been saved, and all primary keys will be cleared.
# Source: http://djangosnippets.org/snippets/904/ (modified with the first comment's suggestion)
for field in obj._meta.fields: