0

OK, I have a model for TemporaryFile and the final file model (File) they have different storage functions (destinations). I'm saving the first model and after some time I need to pass the file to the second model, so that it saves the file its way. For now I'm doing something like that:

attachments.append(File(file=temp.file.file, message=self))

But it just passes over the URL. Which isn't what I'd like to see.

Alasdair
  • 278,338
  • 51
  • 534
  • 489
wswld
  • 1,118
  • 14
  • 31

1 Answers1

0

This questions has been answered here: copy file from one model to another.

Spoilers: it requires StringIO.

Community
  • 1
  • 1
wswld
  • 1,118
  • 14
  • 31