copy file from one model to another
I have 2 simple models: class UploadImage(models.Model): Image = models.ImageField(upload_to="temp/") class RealImage(models.Model): Image = models.ImageField(upload_to="real/") And one form class RealImageForm(ModelForm): class Meta: model = RealImage I need to save file from UploadImage into RealImage. How could i do this. Below code doesn't work realform.Image=UploadImage.objects.get(id=image_id).Image realform.save() Tnx for help. Inspired by Gerard's solution I came up with the following code: from django.core.files.base import ContentFile #... class Example(models.Model): file = models