5
我有一個模型類與filer.fields.image.FilerImageField作爲一個字段。如何以編程方式填充或創建filer.fields.image.FilerImageField?
from filer.fields.image import FilerImageField
class ModelName(Model):
icon = FilerImageField(null=True, blank=True)
如何以編程方式創建或填充圖標字段如果我有一個圖像文件的本地路徑?
ValueError:無法分配「」:「Course.icon」必須是「圖像」實例。 –
Sergey
@ user2120409哦,圖片必須是'filer.models.Image'的一個實例。我已經更新了我的答案,請再試一次。 – iMom0
是的!謝謝。你是對的! – Sergey