1๐
โ
A FileField
ย [Django-doc] is essentially jus a CharField
ย [Django-doc] with some extra logic to wrap the data into a FieldFile
that can then open, write, etc. on the file handler.
You thus can create a document with a TextField
instead:
@registry.register_document
class BookDocument(Document):
image = fields.TextField()
class Index:
name = 'books'
settings = {'number_of_shards': 1, 'number_of_replicas': 0}
class Django:
model = Book
fields = [
'id',
'title',
'description',
]
Source:stackexchange.com