I have some model class with a filer.fields.image.FilerImageField as a field.
from filer.fields.image import FilerImageField
class ModelName(Model):
icon = FilerImageField(null=True, blank=True)
How to programmatically create or fill an icon field if I have a local path to an image file?
You can approach it this way:
image is an instance of
filer.models.Image
, assign it to icon attribute of a Model instance,FilerImageField
will handle it for you.