Ticket #17527: 17527.patch
File 17527.patch, 710 bytes (added by , 13 years ago) |
---|
-
django/db/models/fields/related.py
474 474 def add(self, *objs): 475 475 for obj in objs: 476 476 if not isinstance(obj, self.model): 477 raise TypeError("'%s' instance expected " % self.model._meta.object_name)477 raise TypeError("'%s' instance expected, got %r" % (self.model._meta.object_name, obj)) 478 478 setattr(obj, rel_field.name, self.instance) 479 479 obj.save() 480 480 add.alters_data = True