diff --git a/django/forms/models.py b/django/forms/models.py
index 010d3bf..de5f1ab 100644
a
|
b
|
class BaseModelForm(BaseForm):
|
334 | 334 | fail_message = 'created' |
335 | 335 | else: |
336 | 336 | fail_message = 'changed' |
337 | | return save_instance(self, self.instance, self._meta.fields, fail_message, commit) |
| 337 | return save_instance(self, self.instance, self._meta.fields, |
| 338 | fail_message, commit, exclude=self._meta.exclude) |
338 | 339 | |
339 | 340 | save.alters_data = True |
340 | 341 | |
diff --git a/tests/regressiontests/forms/models.py b/tests/regressiontests/forms/models.py
index 1575953..8a5e312 100644
a
|
b
|
True
|
42 | 42 | {'file1': <SimpleUploadedFile: 我隻氣墊船裝滿晒鱔.txt (text/plain)>} |
43 | 43 | >>> m = FileModel.objects.create(file=f.cleaned_data['file1']) |
44 | 44 | |
45 | | # It's enough that m gets created without error. Preservation of the exotic name is checked |
| 45 | # It's enough that m gets created without error. Preservation of the exotic name is checked |
46 | 46 | # in a file_uploads test; it's hard to do that correctly with doctest's unicode issues. So |
47 | 47 | # we create and then immediately delete m so as to not leave the exotically named file around |
48 | 48 | # for shutil.rmtree (on Windows) to have trouble with later. |
… |
… |
u'instance value'
|
85 | 85 | datetime.date(1969, 4, 4) |
86 | 86 | >>> instance_form.initial['value'] |
87 | 87 | 12 |
| 88 | |
| 89 | >>> from django.forms import CharField |
| 90 | >>> class ExcludingForm(ModelForm): |
| 91 | ... name = CharField(max_length=256) |
| 92 | ... class Meta: |
| 93 | ... model = Defaults |
| 94 | ... exclude = ['name'] |
| 95 | >>> f = ExcludingForm({'name': u'Hello', 'value': 99, 'def_date': datetime.date(1999, 3, 2)}) |
| 96 | >>> f.is_valid() |
| 97 | True |
| 98 | >>> f.cleaned_data['name'] |
| 99 | u'Hello' |
| 100 | >>> obj = f.save() |
| 101 | >>> obj.name |
| 102 | u'class default value' |
| 103 | >>> obj.value |
| 104 | 99 |
| 105 | >>> obj.def_date |
| 106 | datetime.date(1999, 3, 2) |
88 | 107 | >>> shutil.rmtree(temp_storage_location) |
89 | 108 | """} |