This pull request introduces several changes to the support_sphere project, primarily focusing on adding new models and updating existing ones to enhance the resource management system. The most important changes include the addition of the ResourceCV model, modifications to the Resource and ResourceType models, and updates to the database sample data script to populate new resource types and controlled vocabulary.
New Models and Relationships:
src/support_sphere_py/src/support_sphere/models/public/resource_cv.py: Added a new ResourceCV model to represent resource controlled vocabulary items. ([src/support_sphere_py/src/support_sphere/models/public/resource_cv.pyR1-R28](diffhunk://#diff-19802de6232ebc3a97a5bb6d811d4a9c43041f36b77995baf3ddeae4075f26f9R1-R28))
src/support_sphere_py/src/support_sphere/models/public/resource.py: Updated the Resource model to include a relationship with ResourceCV and replaced the name and description fields with resource_cv_id. ([src/support_sphere_py/src/support_sphere/models/public/resource.pyL39-R48](diffhunk://#diff-0a902dfe2186914754b8a0bc1f13c45e45c31b5e1003fd9f78d6ca7aa843cc3fL39-R48))
Model Updates:
src/support_sphere_py/src/support_sphere/models/public/__init__.py: Imported the new ResourceCV model and added it to the __all__ list. ([[1]](diffhunk://#diff-2fd7615f1a2aa0dcf722cc23576a73dfd71ba3f0009a670526f6303ab10e8ef6R15), [[2]](diffhunk://#diff-2fd7615f1a2aa0dcf722cc23576a73dfd71ba3f0009a670526f6303ab10e8ef6R43))
src/support_sphere_py/src/support_sphere/models/public/resource_type.py: Added an optional description field to the ResourceType model. ([[1]](diffhunk://#diff-5b7b32b83944726536b84d2cfabfd71820b33ff85fd5957f8eb0ab8daa52d2ffR17-R18), [[2]](diffhunk://#diff-5b7b32b83944726536b84d2cfabfd71820b33ff85fd5957f8eb0ab8daa52d2ffR30))
Database Sample Data:
src/support_sphere_py/tests/resources/data/resources_cv.csv: Added a CSV file containing resource controlled vocabulary items and their descriptions. ([src/support_sphere_py/tests/resources/data/resources_cv.csvR1-R92](diffhunk://#diff-a6adbf3ac0808dc772861567fa591419ea93fa9aa55abba1777130d7e4c8662eR1-R92))
src/support_sphere_py/tests/resources/scripts/update_db_sample_data.py: Updated the script to populate the new ResourceType and ResourceCV data into the database. ([[1]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bL8-R8), [[2]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bR21-R49), [[3]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bR177-R179))
Configuration Updates:
pixi.toml: Added a new dependency setup-and-load which depends on setup-infra and setup-db-data-via-k8s-job. ([pixi.tomlR79](diffhunk://#diff-b092682f0ad15a352f9fa2b0a67c992454b586275ee76b74a5839ab9afdf9894R79))This pull request introduces several changes to the support_sphere project, focusing on adding a new ResourceCV model, updating dependencies, and enhancing database sample data population scripts. The most important changes include adding the ResourceCV model, updating the Resource model to use ResourceCV, and populating the database with resource types and controlled vocabulary items.
New Model Addition:
src/support_sphere_py/src/support_sphere/models/public/resource_cv.py: Added the ResourceCV model representing a list of resource controlled vocabulary items. ([src/support_sphere_py/src/support_sphere/models/public/resource_cv.pyR1-R28](diffhunk://#diff-19802de6232ebc3a97a5bb6d811d4a9c43041f36b77995baf3ddeae4075f26f9R1-R28))
Model Updates:
src/support_sphere_py/src/support_sphere/models/public/resource.py: Updated the Resource model to include a foreign key to ResourceCV and established a relationship between Resource and ResourceCV. ([src/support_sphere_py/src/support_sphere/models/public/resource.pyL39-R48](diffhunk://#diff-0a902dfe2186914754b8a0bc1f13c45e45c31b5e1003fd9f78d6ca7aa843cc3fL39-R48))
src/support_sphere_py/src/support_sphere/models/public/__init__.py: Imported ResourceCV and added it to the __all__ list. ([[1]](diffhunk://#diff-2fd7615f1a2aa0dcf722cc23576a73dfd71ba3f0009a670526f6303ab10e8ef6R15), [[2]](diffhunk://#diff-2fd7615f1a2aa0dcf722cc23576a73dfd71ba3f0009a670526f6303ab10e8ef6R43))
Database Sample Data Population:
src/support_sphere_py/tests/resources/data/resources_cv.csv: Added a CSV file containing sample data for ResourceCV items. ([src/support_sphere_py/tests/resources/data/resources_cv.csvR1-R92](diffhunk://#diff-a6adbf3ac0808dc772861567fa591419ea93fa9aa55abba1777130d7e4c8662eR1-R92))
src/support_sphere_py/tests/resources/scripts/update_db_sample_data.py: Added functions to populate ResourceType and ResourceCV data into the database and updated the main execution block to call these functions. ([[1]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bL8-R8), [[2]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bR21-R49), [[3]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bR177-R179))
Configuration Updates:
pixi.toml: Added a new dependency setup-and-load that depends on setup-infra and setup-db-data-via-k8s-job. ([pixi.tomlR79](diffhunk://#diff-b092682f0ad15a352f9fa2b0a67c992454b586275ee76b74a5839ab9afdf9894R79))
This pull request introduces several changes to the
support_sphere
project, primarily focusing on adding new models and updating existing ones to enhance the resource management system. The most important changes include the addition of theResourceCV
model, modifications to theResource
andResourceType
models, and updates to the database sample data script to populate new resource types and controlled vocabulary.New Models and Relationships:
src/support_sphere_py/src/support_sphere/models/public/resource_cv.py
: Added a newResourceCV
model to represent resource controlled vocabulary items. ([src/support_sphere_py/src/support_sphere/models/public/resource_cv.pyR1-R28](diffhunk://#diff-19802de6232ebc3a97a5bb6d811d4a9c43041f36b77995baf3ddeae4075f26f9R1-R28)
)src/support_sphere_py/src/support_sphere/models/public/resource.py
: Updated theResource
model to include a relationship withResourceCV
and replaced thename
anddescription
fields withresource_cv_id
. ([src/support_sphere_py/src/support_sphere/models/public/resource.pyL39-R48](diffhunk://#diff-0a902dfe2186914754b8a0bc1f13c45e45c31b5e1003fd9f78d6ca7aa843cc3fL39-R48)
)Model Updates:
src/support_sphere_py/src/support_sphere/models/public/__init__.py
: Imported the newResourceCV
model and added it to the__all__
list. ([[1]](diffhunk://#diff-2fd7615f1a2aa0dcf722cc23576a73dfd71ba3f0009a670526f6303ab10e8ef6R15)
,[[2]](diffhunk://#diff-2fd7615f1a2aa0dcf722cc23576a73dfd71ba3f0009a670526f6303ab10e8ef6R43)
)src/support_sphere_py/src/support_sphere/models/public/resource_type.py
: Added an optionaldescription
field to theResourceType
model. ([[1]](diffhunk://#diff-5b7b32b83944726536b84d2cfabfd71820b33ff85fd5957f8eb0ab8daa52d2ffR17-R18)
,[[2]](diffhunk://#diff-5b7b32b83944726536b84d2cfabfd71820b33ff85fd5957f8eb0ab8daa52d2ffR30)
)Database Sample Data:
src/support_sphere_py/tests/resources/data/resources_cv.csv
: Added a CSV file containing resource controlled vocabulary items and their descriptions. ([src/support_sphere_py/tests/resources/data/resources_cv.csvR1-R92](diffhunk://#diff-a6adbf3ac0808dc772861567fa591419ea93fa9aa55abba1777130d7e4c8662eR1-R92)
)src/support_sphere_py/tests/resources/scripts/update_db_sample_data.py
: Updated the script to populate the newResourceType
andResourceCV
data into the database. ([[1]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bL8-R8)
,[[2]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bR21-R49)
,[[3]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bR177-R179)
)Configuration Updates:
pixi.toml
: Added a new dependencysetup-and-load
which depends onsetup-infra
andsetup-db-data-via-k8s-job
. ([pixi.tomlR79](diffhunk://#diff-b092682f0ad15a352f9fa2b0a67c992454b586275ee76b74a5839ab9afdf9894R79)
)This pull request introduces several changes to thesupport_sphere
project, focusing on adding a newResourceCV
model, updating dependencies, and enhancing database sample data population scripts. The most important changes include adding theResourceCV
model, updating theResource
model to useResourceCV
, and populating the database with resource types and controlled vocabulary items.New Model Addition:
src/support_sphere_py/src/support_sphere/models/public/resource_cv.py
: Added theResourceCV
model representing a list of resource controlled vocabulary items. ([src/support_sphere_py/src/support_sphere/models/public/resource_cv.pyR1-R28](diffhunk://#diff-19802de6232ebc3a97a5bb6d811d4a9c43041f36b77995baf3ddeae4075f26f9R1-R28)
)Model Updates:
src/support_sphere_py/src/support_sphere/models/public/resource.py
: Updated theResource
model to include a foreign key toResourceCV
and established a relationship betweenResource
andResourceCV
. ([src/support_sphere_py/src/support_sphere/models/public/resource.pyL39-R48](diffhunk://#diff-0a902dfe2186914754b8a0bc1f13c45e45c31b5e1003fd9f78d6ca7aa843cc3fL39-R48)
)src/support_sphere_py/src/support_sphere/models/public/__init__.py
: ImportedResourceCV
and added it to the__all__
list. ([[1]](diffhunk://#diff-2fd7615f1a2aa0dcf722cc23576a73dfd71ba3f0009a670526f6303ab10e8ef6R15)
,[[2]](diffhunk://#diff-2fd7615f1a2aa0dcf722cc23576a73dfd71ba3f0009a670526f6303ab10e8ef6R43)
)Database Sample Data Population:
src/support_sphere_py/tests/resources/data/resources_cv.csv
: Added a CSV file containing sample data forResourceCV
items. ([src/support_sphere_py/tests/resources/data/resources_cv.csvR1-R92](diffhunk://#diff-a6adbf3ac0808dc772861567fa591419ea93fa9aa55abba1777130d7e4c8662eR1-R92)
)src/support_sphere_py/tests/resources/scripts/update_db_sample_data.py
: Added functions to populateResourceType
andResourceCV
data into the database and updated the main execution block to call these functions. ([[1]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bL8-R8)
,[[2]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bR21-R49)
,[[3]](diffhunk://#diff-7ca4dd666d4bf5c1344d9b43a9354dea92bc700f7f655cbd3865e752d9f2b72bR177-R179)
)Configuration Updates:
pixi.toml
: Added a new dependencysetup-and-load
that depends onsetup-infra
andsetup-db-data-via-k8s-job
. ([pixi.tomlR79](diffhunk://#diff-b092682f0ad15a352f9fa2b0a67c992454b586275ee76b74a5839ab9afdf9894R79)
)Related Issue
Resolved #164