Data Importer Package¶
Submodules¶
Managers¶
Models¶
URLs¶
Utils¶
-
class
seed.data_importer.utils.
CoercionRobot
¶ Bases:
object
-
lookup_hash
(uncoerced_value, destination_model, destination_field)¶
-
make_key
(value, model, field)¶
-
-
seed.data_importer.utils.
acquire_lock
(name, expiration=None)¶ Tries to acquire a lock from the cache. Also sets the lock’s value to the current time, allowing us to see how long it has been held.
Returns False if lock already belongs by another process.
-
seed.data_importer.utils.
chunk_iterable
(iter, chunk_size)¶ Breaks an iterable (e.g. list) into smaller chunks, returning a generator of the chunk.
-
seed.data_importer.utils.
get_core_pk_column
(table_column_mappings, primary_field)¶
-
seed.data_importer.utils.
get_lock_time
(name)¶ Examines a lock to see when it was acquired.
-
seed.data_importer.utils.
release_lock
(name)¶ Frees a lock.
Views¶
-
class
seed.data_importer.views.
LocalUploaderViewSet
(**kwargs) Bases:
rest_framework.viewsets.GenericViewSet
Endpoint to upload data files to, if uploading to local file storage. Valid source_type values are found in
seed.models.SEED_DATA_SOURCES
Returns:
{ 'success': True, 'import_file_id': The ID of the newly-uploaded ImportFile }
-
create
(request, *args, **kwargs) Upload a new file to an import_record. This is a multipart/form upload. — parameters:
- name: import_record description: the ID of the ImportRecord to associate this file with. required: true paramType: body
- name: source_type description: the type of file (e.g. ‘Portfolio Raw’ or ‘Assessed Raw’) required: false paramType: body
- name: source_program_version description: the version of the file as related to the source_type required: false paramType: body
- name: file or qqfile description: In-memory file object required: true paramType: Multipart
-
suffix
= None
-