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
  • 298,606
  • 55
  • 578
  • 516
wswld
  • 1,218
  • 15
  • 32

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,218
  • 15
  • 32