Ticket #6702: newforms_models_assert_isinstance.diff

File newforms_models_assert_isinstance.diff, 635 bytes (added by Thomas Güttler, 17 years ago)
  • django/newforms/models.py

     
    250250            self.instance = opts.model()
    251251            object_data = {}
    252252        else:
     253            assert isinstance(instance, opts.model), 'instance (%r)  must be an instance of %r' % (
     254                instance, opts.model)
    253255            self.instance = instance
    254256            object_data = model_to_dict(instance, opts.fields, opts.exclude)
    255257        # if initial was provided, it should override the values from instance
Back to Top