ImageMagick とバインディング ワンドを使用して、Django にアップロードされた画像のサムネイルを生成しています。サムネイルをうまく生成できますが、画像オブジェクトを ImageMagick から Django モデルに戻す方法がわかりません。だから私は以下のように単純化されたモデルを持っています:
from wand import Image
class Attachment(models.Model):
    attachment = models.FileField(upload_to="some_path")
    thumbnail = models.ImageField(upload_to="other_path")
    def generate_thumb(self):
        with Image(file=self.attachment) as wand:
            thumb = wand.resize(width=50, height=50)
            thumb.save(file=self.thumbnail)
ValueError: The 'thumbnail' attribute has no file associated with it.  これにより、 Is there a simple way to get a file object out of wand and into django without too much sillies?の最後の行でエラーが生成されます。
ありがとう。