Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Add cloning functionality #36

Merged
merged 13 commits into from
Jun 22, 2021
Merged

[ENH] Add cloning functionality #36

merged 13 commits into from
Jun 22, 2021

Conversation

jdkent
Copy link
Member

@jdkent jdkent commented Jun 3, 2021

This pull request adds the ability to clone a study.

Comment on lines 255 to 282
@classmethod
def _load_from_source(cls, source, source_id):
if source == "neurostore":
return cls.load_from_neurostore(source_id)
elif source == "neurovault":
return cls.load_from_neurovault(source_id)
elif source == "pubmed":
return cls.load_from_pubmed(source_id)

@classmethod
def load_from_neurostore(cls, source_id):
study = cls._model.query.filter_by(id=source_id).first_or_404()
data = cls._schema(copy=True).dump(study)
data['source'] = "neurostore"
data['source_id'] = source_id
data['source_updated_at'] = study.updated_at or study.created_at
return data



@classmethod
def load_from_neurovault(cls, source_id):
pass

@classmethod
def load_from_pubmed(cls, source_id):
pass

Copy link
Member Author

@jdkent jdkent Jun 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tyarkoni, is this structure what you were thinking for cloning/copying from sources?

@jdkent jdkent merged commit 769454d into neurostuff:master Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant