Skip to content
Snippets Groups Projects
Commit 929aaf09 authored by David Sikter's avatar David Sikter
Browse files

Renamed Dataset.created -> Dataset.dataset_create_time and Dataset.modified ->...

Renamed Dataset.created -> Dataset.dataset_create_time and Dataset.modified -> Dataset.dataset_modified_time
parent d07e4424
Branches
No related tags found
3 merge requests!548Release v1,!461Draft: remove owner key from the query,!409Refactoring metadata: using a consistent flat structure in MongoDB
...@@ -218,8 +218,8 @@ async def post_datasets( ...@@ -218,8 +218,8 @@ async def post_datasets(
dataset_id=create_uuid(), dataset_id=create_uuid(),
dataset_name=create.dataset_name, dataset_name=create.dataset_name,
user_id=user.user_id, user_id=user.user_id,
created=now, dataset_create_time=now,
modified=now, dataset_modified_time=now,
dataset_type=dataset_type) dataset_type=dataset_type)
dataset.a_mongo.create() dataset.a_mongo.create()
......
...@@ -1262,7 +1262,7 @@ async def post_entry_metadata_edit( ...@@ -1262,7 +1262,7 @@ async def post_entry_metadata_edit(
if not verify: if not verify:
dataset = datamodel.Dataset( dataset = datamodel.Dataset(
dataset_id=utils.create_uuid(), user_id=user.user_id, dataset_id=utils.create_uuid(), user_id=user.user_id,
dataset_name=action_value, created=datetime.utcnow()) dataset_name=action_value, dataset_create_time=datetime.utcnow())
dataset.a_mongo.create() dataset.a_mongo.create()
mongo_value = dataset.dataset_id mongo_value = dataset.dataset_id
......
...@@ -108,7 +108,7 @@ class User(Author): ...@@ -108,7 +108,7 @@ class User(Author):
last_name: The users last name last_name: The users last name
affiliation: The name of the company and institutes the user identifies with affiliation: The name of the company and institutes the user identifies with
affiliation_address: The address of the given affiliation affiliation_address: The address of the given affiliation
create: The time the account was created created: The time the account was created
repo_user_id: The id that was used to identify this user in the NOMAD CoE Repository repo_user_id: The id that was used to identify this user in the NOMAD CoE Repository
is_admin: Bool that indicated, iff the user the use admin user is_admin: Bool that indicated, iff the user the use admin user
''' '''
...@@ -212,9 +212,9 @@ class Dataset(metainfo.MSection): ...@@ -212,9 +212,9 @@ class Dataset(metainfo.MSection):
full URL, e.g. "10.17172/nomad/2019.10.29-1". full URL, e.g. "10.17172/nomad/2019.10.29-1".
pid: The original NOMAD CoE Repository dataset PID. Old DOIs still reference pid: The original NOMAD CoE Repository dataset PID. Old DOIs still reference
datasets based on this id. Is not used for new datasets. datasets based on this id. Is not used for new datasets.
created: The date when the dataset was first created. dataset_create_time: The date when the dataset was first created.
modified: The date when the dataset was last modified. An owned dataset can only dataset_modified_time: The date when the dataset was last modified. An owned dataset
be extended after a DOI was assigned. A foreign dataset cannot be changed can only be extended after a DOI was assigned. A foreign dataset cannot be changed
once a DOI was assigned. once a DOI was assigned.
dataset_type: The type determined if a dataset is owned, i.e. was created by dataset_type: The type determined if a dataset is owned, i.e. was created by
the uploader/owner of the contained entries; or if a dataset is foreign, the uploader/owner of the contained entries; or if a dataset is foreign,
...@@ -243,11 +243,11 @@ class Dataset(metainfo.MSection): ...@@ -243,11 +243,11 @@ class Dataset(metainfo.MSection):
pid = metainfo.Quantity( pid = metainfo.Quantity(
type=str, type=str,
a_mongo=Mongo(index=True)) a_mongo=Mongo(index=True))
created = metainfo.Quantity( dataset_create_time = metainfo.Quantity(
type=metainfo.Datetime, type=metainfo.Datetime,
a_mongo=Mongo(index=True), a_mongo=Mongo(index=True),
a_elasticsearch=Elasticsearch()) a_elasticsearch=Elasticsearch())
modified = metainfo.Quantity( dataset_modified_time = metainfo.Quantity(
type=metainfo.Datetime, type=metainfo.Datetime,
a_mongo=Mongo(index=True), a_mongo=Mongo(index=True),
a_elasticsearch=Elasticsearch()) a_elasticsearch=Elasticsearch())
......
...@@ -46,7 +46,7 @@ to assert for certain aspects in the responses. ...@@ -46,7 +46,7 @@ to assert for certain aspects in the responses.
@pytest.fixture(scope='function') @pytest.fixture(scope='function')
def data(elastic, raw_files, mongo, test_user, other_test_user): def data(elastic, raw_files, mongo, test_user, other_test_user):
def create_dataset(**kwargs): def create_dataset(**kwargs):
dataset = Dataset(created=datetime.now(), modified=datetime.now(), **kwargs) dataset = Dataset(dataset_create_time=datetime.now(), dataset_modified_time=datetime.now(), **kwargs)
dataset.m_get_annotations('mongo').save() dataset.m_get_annotations('mongo').save()
return dataset return dataset
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment