Skip to content

Service

flowtask.services.files.service

FileService.

Work with slug-based file definitions, upload, download, enable tasks, etc.

FileService

Bases: BaseView

get async

get()

description: Get all the Files objects in the current scope and program summary: get the files information and attributes tags: - FileService produces: - application/json parameters: - name: user_id description: user id to filter in: path required: true type: integer - name: file_slug description: file slug in: path required: true type: string responses: "200": description: returns valid data "204": description: No data "403": description: Forbidden Call "404": description: Program o File not found "406": description: Query Error

put async

put()

PUT FileService. description: Upload a File and, optionally, running an associated Task Parameters: file_slug: slug of the file in TROC files table program_slug: associated program mimetype: optional mime-type, default csv module_id: optional module ID task: boolean in query-params to disable running task. long_running: query-param to attach a Task in a Thread Pool

valid_permission async

valid_permission(user_id, codename)

valid_permission. Check if the user have permission for one func on the system.

FileUploaded

FileUploaded(post, mimetype=None)

FileUploaded. processing a FileField

valid_content

valid_content(**kwargs)

valid_content. check if is a valid content-type ex: if is a csv, json or excel, open with pandas, if txt with stream, if image, etc