I am having problems with the django / mongoengine application to use django-athumb . I try to save different sizes of images and store them on S3, which is what the athletes do when used with the installation version of django. However, using mongoengine, calling the save () function in an object field causes the ImageWithThumbsField object to not have a save attribute.
inside the views function, which is associated with loading the file (where doc.image is ImageWithThumbsField):
if request.FILES.get('image'): file = request.FILES['image'] fdat = file.read() file_contents = ContentFile(fdat) doc.image.save(file.name, file_contents)
the above results lead to the above error.
if I call instead:
doc.image.attr_class(file_contents, doc.image, file.name).save(file.name, file_contents)
I can access the save method, but it breaks in and can cause more problems than it solves. My question is: since subclasses of ImageWithThumbsField models.ImageField, is it impossible (or at least impractical) to use models.ImageField with mongoengine?
source share