django-service-objects
django-service-objects copied to clipboard
Usage with uploaded files
Any help on how to use this library with uploaded files? I have it working for where I set the service object to normal Django form fields like forms.CharField (where the input data comes from a DRF serializers validated_data).
I've tried using form.FileField, where the input object is a TemporaryUploadedFile, but it keep raising the following exception when trying to clean the service object,
service_objects.errors.InvalidInputsError: ({'uploaded_file': ['This field is required.']}, [])
@mands How are you calling the execute() class method of your service? (Please share code)
My guess is that you need to pass in the files argument to the service:
https://github.com/mixxorz/django-service-objects/blob/master/service_objects/services.py#L64