| 284 | self.file.seek(0) |
| 285 | |
| 286 | def save(self, *args, **kwargs): |
| 287 | # check if this is a subclass of "File" or not and set |
| 288 | # _file_type_plugin_name |
| 289 | if self.__class__ == File: |
| 290 | # what should we do now? |
| 291 | # maybe this has a subclass, but is being saved as a File instance |
| 292 | # anyway. do we need to go check all possible subclasses? |
| 293 | pass |
| 294 | elif issubclass(self.__class__, File): |
| 295 | self._file_type_plugin_name = self.__class__.__name__ |
| 296 | if self._old_is_public != self.is_public and self.pk: |
| 297 | self._move_file() |
| 298 | self._old_is_public = self.is_public |
| 299 | super().save(*args, **kwargs) |
| 300 | save.alters_data = True |
| 301 | |
| 302 | def delete(self, *args, **kwargs): |