def attach_upload(self, request, resource_name, pk, **kwargs):

        try:
            obj = self.cached_obj_get(
                    request=request, pk=pk,
                    **self.remove_api_resource_names(kwargs))
        except ObjectDoesNotExist:
            return http.HttpNotFound()
        except MultipleObjectsReturned:
            return http.HttpMultipleChoices(
                    "More than one resource is found at this URI.")

        for field_name in getattr(self._meta, "uploads", []):
            uploaded_file = request.FILES.get(field_name, None)
            if uploaded_file is not None:
                setattr(obj, field_name, uploaded_file)
        obj.save()
        bundle = self.build_bundle(obj=obj, request=request)
        bundle = self.full_dehydrate(bundle)
        bundle = self.alter_detail_data_to_serialize(request, bundle)
        return self.create_response(request, bundle, http.HttpAccepted)
Raises MethodNotEnabledInCurrentMode if a user tries to interact
dataset/ETHPy150Open mozilla/inventory/vendor-local/src/django-tastytools/tastytools/resources.py/ModelResource.attach_upload--crossover with--dataset/ETHPy150Open edx/bok-choy/bok_choy/performance.py/HarCapturer._validate_mode