Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with uploaded files #61

Open
mands opened this issue Jun 15, 2020 · 1 comment
Open

Usage with uploaded files #61

mands opened this issue Jun 15, 2020 · 1 comment

Comments

@mands
Copy link

mands commented Jun 15, 2020

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.']}, [])
@peterfarrell
Copy link
Contributor

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants