Ticket #1564: manipulators.diff
File manipulators.diff, 898 bytes (added by , 19 years ago) |
---|
-
django/db/models/manipulators.py
98 98 99 99 # First, save the basic object itself. 100 100 new_object = self.model(**params) 101 new_object.save()102 101 103 # Now that the object's been saved, save any uploaded files.102 # Now that the object's not yet been saved, save any uploaded files. 104 103 for f in self.opts.fields: 105 104 if isinstance(f, FileField): 106 105 f.save_file(new_data, new_object, self.change and self.original_object or None, self.change, rel=False) 107 106 107 new_object.save() 108 108 109 # Calculate which primary fields have changed. 109 110 if self.change: 110 111 self.fields_added, self.fields_changed, self.fields_deleted = [], [], []