1đź‘Ť
âś…
In general, you can do this with self.changed_data
, which returns a list of the names of the fields where the value changed. Whether there’s anything special about a FileField
that would interfere I don’t know offhand.
👤Peter DeGlopper
0đź‘Ť
In js,
- In JS, set a global variable file_changed = 0.
- HTML input tag < input ng-model=”avatar” type=”file” onchange=”ChangeFile()”>
- Lets say ChangeFile() will provide a small preview of the file to be uploaded
- In function ChangeFile set file_changed=1 once the file is selected.
👤SuperNova
- Overwrite django restframework CreateModelMixin serializer error message
- Different models in one view
- M2m for existing table (through/unique_together)
Source:stackexchange.com