def attach_upload(self, request, resource_name, pk, **kwargs):
        """Attaches uploaded files to the resource"""

        try:
            obj = self.cached_obj_get(
                    request=request, pk=pk,
                    **self.remove_api_resource_names(kwargs))
        except __HOLE__:
            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)
dataset/ETHPy150Open mozilla/inventory/vendor-local/src/django-tastytools/tastytools/resources.py/ModelResource.attach_upload