diff --git a/src/resources/entities/applications_endpoints.py b/src/resources/entities/applications_endpoints.py index f47ef231..f19f65b2 100644 --- a/src/resources/entities/applications_endpoints.py +++ b/src/resources/entities/applications_endpoints.py @@ -3,7 +3,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(APPLICATION, request.json) - return get_row_by_id(APPLICATION, request.json["id"].to_dict()), 200 + return create_rows_from_json(APPLICATION, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/datacollection_datafiles_endpoints.py b/src/resources/entities/datacollection_datafiles_endpoints.py index 9fac3085..11e36a28 100644 --- a/src/resources/entities/datacollection_datafiles_endpoints.py +++ b/src/resources/entities/datacollection_datafiles_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATACOLLECTIONDATAFILE from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,8 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(DATACOLLECTIONDATAFILE, request.json) - return get_row_by_id(DATACOLLECTIONDATAFILE, request.json["id"].to_dict()), 200 + return create_rows_from_json(DATACOLLECTIONDATAFILE, request.json), 200 + @requires_session_id @queries_records diff --git a/src/resources/entities/datacollection_datasets_endpoints.py b/src/resources/entities/datacollection_datasets_endpoints.py index 2d4447aa..f8918f7f 100644 --- a/src/resources/entities/datacollection_datasets_endpoints.py +++ b/src/resources/entities/datacollection_datasets_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATACOLLECTIONDATASET from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(DATACOLLECTIONDATASET, request.json) - return get_row_by_id(DATACOLLECTIONDATASET, request.json["id"].to_dict()), 200 + return create_rows_from_json(DATACOLLECTIONDATASET, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/datacollection_parameters_endpoints.py b/src/resources/entities/datacollection_parameters_endpoints.py index d2c9bd4b..0c943108 100644 --- a/src/resources/entities/datacollection_parameters_endpoints.py +++ b/src/resources/entities/datacollection_parameters_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, patch_entities, create_rows_from_json from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATACOLLECTIONPARAMETER from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(DATACOLLECTIONPARAMETER, request.json) - return get_row_by_id(DATACOLLECTIONPARAMETER, request.json["id"].to_dict()), 200 + return create_rows_from_json(DATACOLLECTIONPARAMETER, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/datacollections_endpoints.py b/src/resources/entities/datacollections_endpoints.py index 5eed7f95..b3e2d38c 100644 --- a/src/resources/entities/datacollections_endpoints.py +++ b/src/resources/entities/datacollections_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATACOLLECTION from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(DATACOLLECTION, request.json) - return get_row_by_id(DATACOLLECTION, request.json["id"].to_dict()), 200 + return create_rows_from_json(DATACOLLECTION, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/datafile_formats_endpoints.py b/src/resources/entities/datafile_formats_endpoints.py index ed86621a..fd4a4db9 100644 --- a/src/resources/entities/datafile_formats_endpoints.py +++ b/src/resources/entities/datafile_formats_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATAFILEFORMAT from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(DATAFILEFORMAT, request.json) - return get_row_by_id(DATAFILEFORMAT, request.json["id"].to_dict()), 200 + return create_rows_from_json(DATAFILEFORMAT, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/datafile_parameters_endpoints.py b/src/resources/entities/datafile_parameters_endpoints.py index 5511eedf..99f181d8 100644 --- a/src/resources/entities/datafile_parameters_endpoints.py +++ b/src/resources/entities/datafile_parameters_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATAFILEPARAMETER from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(DATAFILEPARAMETER, request.json) - return get_row_by_id(DATAFILEPARAMETER, request.json["id"].to_dict()), 200 + return create_rows_from_json(DATAFILEPARAMETER, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/datafiles_endpoints.py b/src/resources/entities/datafiles_endpoints.py index 8d891607..7101ae1a 100644 --- a/src/resources/entities/datafiles_endpoints.py +++ b/src/resources/entities/datafiles_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATAFILE from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(DATAFILE, request.json) - return "", 200 + return create_rows_from_json(DATAFILE, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/dataset_type_endpoints.py b/src/resources/entities/dataset_type_endpoints.py index 0455b828..a8667ea9 100644 --- a/src/resources/entities/dataset_type_endpoints.py +++ b/src/resources/entities/dataset_type_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATASETTYPE from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(DATASETTYPE, request.json) - return get_row_by_id(DATASETTYPE, request.json["id"].to_dict()), 200 + return create_rows_from_json(DATASETTYPE, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/datasets_endpoints.py b/src/resources/entities/datasets_endpoints.py index dd2f736f..002ae716 100644 --- a/src/resources/entities/datasets_endpoints.py +++ b/src/resources/entities/datasets_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATASET from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(DATASET, request.json) - return get_row_by_id(DATASET, request.json["id"].to_dict()), 200 + return create_rows_from_json(DATASET, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/facilities_endpoints.py b/src/resources/entities/facilities_endpoints.py index 3ce016d0..4cdb5d28 100644 --- a/src/resources/entities/facilities_endpoints.py +++ b/src/resources/entities/facilities_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import FACILITY from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(FACILITY, request.json) - return get_row_by_id(FACILITY, request.json["id"].to_dict()), 200 + return create_rows_from_json(FACILITY, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/facility_cycles_endpoints.py b/src/resources/entities/facility_cycles_endpoints.py index 3bdf54c7..a28cdec9 100644 --- a/src/resources/entities/facility_cycles_endpoints.py +++ b/src/resources/entities/facility_cycles_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import FACILITYCYCLE from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(FACILITYCYCLE, request.json) - return get_row_by_id(FACILITYCYCLE, request.json["id"].to_dict()), 200 + return create_rows_from_json(FACILITYCYCLE, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/groupings_endpoints.py b/src/resources/entities/groupings_endpoints.py index b4c0000b..73f9067b 100644 --- a/src/resources/entities/groupings_endpoints.py +++ b/src/resources/entities/groupings_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import GROUPING from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(GROUPING, request.json) - return get_row_by_id(GROUPING, request.json["id"].to_dict()), 200 + return create_rows_from_json(GROUPING, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/instrument_scientists_endpoints.py b/src/resources/entities/instrument_scientists_endpoints.py index 293d5db0..28d2e56d 100644 --- a/src/resources/entities/instrument_scientists_endpoints.py +++ b/src/resources/entities/instrument_scientists_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INSTRUMENTSCIENTIST from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(INSTRUMENTSCIENTIST, request.json) - return get_row_by_id(INSTRUMENTSCIENTIST, request.json["id"].to_dict()), 200 + return create_rows_from_json(INSTRUMENTSCIENTIST, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/instruments_endpoints.py b/src/resources/entities/instruments_endpoints.py index 7dcfc204..46b80d63 100644 --- a/src/resources/entities/instruments_endpoints.py +++ b/src/resources/entities/instruments_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INSTRUMENT from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(INSTRUMENT, request.json) - return get_row_by_id(INSTRUMENT, request.json["id"].to_dict()), 200 + return create_rows_from_json(INSTRUMENT, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/investigation_groups_endpoints.py b/src/resources/entities/investigation_groups_endpoints.py index f2e76927..c608b207 100644 --- a/src/resources/entities/investigation_groups_endpoints.py +++ b/src/resources/entities/investigation_groups_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATIONGROUP from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(INVESTIGATIONGROUP, request.json) - return get_row_by_id(INVESTIGATIONGROUP, request.json["id"].to_dict()), 200 + return create_rows_from_json(INVESTIGATIONGROUP, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/investigation_instruments_endpoints.py b/src/resources/entities/investigation_instruments_endpoints.py index e969b4b2..e8b6cb38 100644 --- a/src/resources/entities/investigation_instruments_endpoints.py +++ b/src/resources/entities/investigation_instruments_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATIONINSTRUMENT from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(INVESTIGATIONINSTRUMENT, request.json) - return get_row_by_id(INVESTIGATIONINSTRUMENT, request.json["id"].to_dict()), 200 + return create_rows_from_json(INVESTIGATIONINSTRUMENT, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/investigation_parameters_endpoints.py b/src/resources/entities/investigation_parameters_endpoints.py index b5b068d9..77da3f50 100644 --- a/src/resources/entities/investigation_parameters_endpoints.py +++ b/src/resources/entities/investigation_parameters_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATIONPARAMETER from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(INVESTIGATIONPARAMETER, request.json) - return get_row_by_id(INVESTIGATIONPARAMETER, request.json["id"].to_dict()), 200 + return create_rows_from_json(INVESTIGATIONPARAMETER, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/investigation_types_endpoints.py b/src/resources/entities/investigation_types_endpoints.py index 7bb7bd75..c4111b26 100644 --- a/src/resources/entities/investigation_types_endpoints.py +++ b/src/resources/entities/investigation_types_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATIONTYPE from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(INVESTIGATIONTYPE, request.json) - return get_row_by_id(INVESTIGATIONTYPE, request.json["id"].to_dict()), 200 + return create_rows_from_json(INVESTIGATIONTYPE, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/investigation_users_endpoints.py b/src/resources/entities/investigation_users_endpoints.py index f63acbaa..9c6c9037 100644 --- a/src/resources/entities/investigation_users_endpoints.py +++ b/src/resources/entities/investigation_users_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATIONUSER from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(INVESTIGATIONUSER, request.json) - return get_row_by_id(INVESTIGATIONUSER, request.json["id"].to_dict()), 200 + return create_rows_from_json(INVESTIGATIONUSER, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/investigations_endpoints.py b/src/resources/entities/investigations_endpoints.py index 8e2607b4..f420ebc3 100644 --- a/src/resources/entities/investigations_endpoints.py +++ b/src/resources/entities/investigations_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATION from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(INVESTIGATION, request.json) - return get_row_by_id(INVESTIGATION, request.json["id"].to_dict()), 200 + return create_rows_from_json(INVESTIGATION, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/jobs_endpoints.py b/src/resources/entities/jobs_endpoints.py index 12e7cdd5..54696598 100644 --- a/src/resources/entities/jobs_endpoints.py +++ b/src/resources/entities/jobs_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import JOB from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(JOB, request.json) - return get_row_by_id(JOB, request.json["id"].to_dict()), 200 + return create_rows_from_json(JOB, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/keywords_endpoints.py b/src/resources/entities/keywords_endpoints.py index 500b0a4a..1e0c263e 100644 --- a/src/resources/entities/keywords_endpoints.py +++ b/src/resources/entities/keywords_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import KEYWORD from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(KEYWORD, request.json) - return get_row_by_id(KEYWORD, request.json["id"].to_dict()), 200 + return create_rows_from_json(KEYWORD, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/parameter_types_endpoints.py b/src/resources/entities/parameter_types_endpoints.py index 981aaa77..28010ae1 100644 --- a/src/resources/entities/parameter_types_endpoints.py +++ b/src/resources/entities/parameter_types_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import PARAMETERTYPE from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(PARAMETERTYPE, request.json) - return get_row_by_id(PARAMETERTYPE, request.json["id"].to_dict()), 200 + return create_rows_from_json(PARAMETERTYPE, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/permissible_string_values_endpoints.py b/src/resources/entities/permissible_string_values_endpoints.py index 1053120f..e2b8900a 100644 --- a/src/resources/entities/permissible_string_values_endpoints.py +++ b/src/resources/entities/permissible_string_values_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import PERMISSIBLESTRINGVALUE from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(PERMISSIBLESTRINGVALUE, request.json) - return get_row_by_id(PERMISSIBLESTRINGVALUE, request.json["id"].to_dict()), 200 + return create_rows_from_json(PERMISSIBLESTRINGVALUE, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/public_steps_endpoints.py b/src/resources/entities/public_steps_endpoints.py index 0cd519ac..8247a88f 100644 --- a/src/resources/entities/public_steps_endpoints.py +++ b/src/resources/entities/public_steps_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import PUBLICSTEP from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(PUBLICSTEP, request.json) - return get_row_by_id(PUBLICSTEP, request.json["id"].to_dict()), 200 + return create_rows_from_json(PUBLICSTEP, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/publications_endpoints.py b/src/resources/entities/publications_endpoints.py index 2079b940..825c3dea 100644 --- a/src/resources/entities/publications_endpoints.py +++ b/src/resources/entities/publications_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import PUBLICATION from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(PUBLICATION, request.json) - return get_row_by_id(PUBLICATION, request.json["id"].to_dict()), 200 + return create_rows_from_json(PUBLICATION, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/related_datafiles_endpoints.py b/src/resources/entities/related_datafiles_endpoints.py index 89db3031..47aac5fa 100644 --- a/src/resources/entities/related_datafiles_endpoints.py +++ b/src/resources/entities/related_datafiles_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import RELATEDDATAFILE from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(RELATEDDATAFILE, request.json) - return get_row_by_id(RELATEDDATAFILE, request.json["id"].to_dict()), 200 + return create_rows_from_json(RELATEDDATAFILE, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/rules_endpoints.py b/src/resources/entities/rules_endpoints.py index bcabdb59..c1d89e19 100644 --- a/src/resources/entities/rules_endpoints.py +++ b/src/resources/entities/rules_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import RULE from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(RULE, request.json) - return get_row_by_id(RULE, request.json["id"].to_dict()), 200 + return create_rows_from_json(RULE, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/sample_parameters_endpoints.py b/src/resources/entities/sample_parameters_endpoints.py index 2d6c1ce8..341b307f 100644 --- a/src/resources/entities/sample_parameters_endpoints.py +++ b/src/resources/entities/sample_parameters_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import SAMPLEPARAMETER from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(SAMPLEPARAMETER, request.json) - return get_row_by_id(SAMPLEPARAMETER, request.json["id"].to_dict()), 200 + return create_rows_from_json(SAMPLEPARAMETER, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/sample_types_endpoints.py b/src/resources/entities/sample_types_endpoints.py index 0b1c0a19..916f904b 100644 --- a/src/resources/entities/sample_types_endpoints.py +++ b/src/resources/entities/sample_types_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import SAMPLETYPE from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(SAMPLETYPE, request.json) - return get_row_by_id(SAMPLETYPE, request.json["id"].to_dict()), 200 + return create_rows_from_json(SAMPLETYPE, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/samples_endpoints.py b/src/resources/entities/samples_endpoints.py index ac32465e..41769569 100644 --- a/src/resources/entities/samples_endpoints.py +++ b/src/resources/entities/samples_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import SAMPLE from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(SAMPLE, request.json) - return get_row_by_id(SAMPLE, request.json["id"].to_dict()), 200 + return create_rows_from_json(SAMPLE, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/shifts_endpoints.py b/src/resources/entities/shifts_endpoints.py index 86771697..9a3611df 100644 --- a/src/resources/entities/shifts_endpoints.py +++ b/src/resources/entities/shifts_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import SHIFT from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(SHIFT, request.json) - return get_row_by_id(SHIFT, request.json["id"].to_dict()), 200 + return create_rows_from_json(SHIFT, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/studies_endpoints.py b/src/resources/entities/studies_endpoints.py index 03eae006..78d74976 100644 --- a/src/resources/entities/studies_endpoints.py +++ b/src/resources/entities/studies_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import STUDY from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(STUDY, request.json) - return get_row_by_id(STUDY, request.json["id"].to_dict()), 200 + return create_rows_from_json(STUDY, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/study_investigations_endpoints.py b/src/resources/entities/study_investigations_endpoints.py index 0e385eb1..a12c8679 100644 --- a/src/resources/entities/study_investigations_endpoints.py +++ b/src/resources/entities/study_investigations_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import STUDYINVESTIGATION from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(STUDYINVESTIGATION, request.json) - return get_row_by_id(STUDYINVESTIGATION, request.json["id"].to_dict()), 200 + return create_rows_from_json(STUDYINVESTIGATION, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/user_groups_endpoints.py b/src/resources/entities/user_groups_endpoints.py index d553e50c..7030a90f 100644 --- a/src/resources/entities/user_groups_endpoints.py +++ b/src/resources/entities/user_groups_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import USERGROUP from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(USERGROUP, request.json) - return get_row_by_id(USERGROUP, request.json["id"].to_dict()), 200 + return create_rows_from_json(USERGROUP, request.json), 200 @requires_session_id @queries_records diff --git a/src/resources/entities/users_endpoints.py b/src/resources/entities/users_endpoints.py index 25ca655d..99359a81 100644 --- a/src/resources/entities/users_endpoints.py +++ b/src/resources/entities/users_endpoints.py @@ -2,7 +2,7 @@ from flask_restful import Resource from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ - get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities + get_filtered_row_count, get_first_filtered_row, create_rows_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import USER from src.swagger.swagger_generator import swagger_gen @@ -18,8 +18,7 @@ def get(self): @requires_session_id @queries_records def post(self): - create_row_from_json(USER, request.json) - return get_row_by_id(USER, request.json["id"].to_dict()), 200 + return create_rows_from_json(USER, request.json), 200 @requires_session_id @queries_records