Skip to content

createDataSet fails to create dataset #256

@Castronova

Description

@Castronova

The createDataset function in createService.py fails.

from odm2api.ODM2.services.createService import CreateODM2
writer = CreateODM2(my_local_connection)
writer = ReadODM2(self.connection)
myDataset = writer.createDataset(dstype='my dataset',
                                 dscode='my_dataset',
                                 dstitle='this is my dataset'
                                 dsabstract='some description')

IntegrityError: (IntegrityError) NOT NULL constraint failed: Datasets.DatasetUUID u'INSERT INTO datasets (datasetuuid, datasettypecv, datasetcode, datasettitle, datasetabstract) VALUES (?, ?, ?, ?, ?)' (None, None, None, None, 'test')

The createDataset function sets values for the following variables DatasetTypeCV, DatasetCode, DatasetTitle, DatasetAbstract, DatasetUUID. However, these variables do not exist in the models.py DataSets class, instead they are named DataSet*.

To fix, change the variables that are set in createService.createDataset to match the variables defined in models.DataSets

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions