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

Skeletons #66

Merged
merged 4 commits into from
May 31, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions qiita_db/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ def __init__(self, id_):
"""
self._id = id_

def __eq__(self, other):
return other._id == self._id

def __ne__(self, other):
return not self.__eq__(other)

@property
def id(self):
"""The object id on the storage system"""
Expand Down
79 changes: 79 additions & 0 deletions qiita_db/investigation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
from __future__ import division

"""
Objects for dealing with Qiita studies

This module provides the implementation of the Investigation class.


Classes
-------
- `Investigation` -- A Qiita investigation class
"""
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

from .base import QiitaStatusObject

REQUIRED_KEYS = {"name", "description", "contact_person"}


class Investigation(QiitaStatusObject):
"""
Study object to access to the Qiita Study information

Attributes
----------
name: str
name of the investigation
description: str
description of what the investigation is investigating
contact_person: StudyPerson object
studies: list of Study Objects
all studies that are part of the investigation

Methods
-------
add_study
Adds a study to the investigation
"""
_table = "investigation"

@classmethod
def create(cls, owner, info, investigation=None):
"""Creates a new investigation on the database"""
raise NotImplementedError()

@classmethod
def delete(cls, id_):
"""Deletes an investigation on the database"""
raise NotImplementedError()

@property
def name(self):
raise NotImplementedError()

@name.setter
def name(self, value):
raise NotImplementedError()

@property
def description(self):
raise NotImplementedError()

@description.setter
def description(self, value):
raise NotImplementedError()

@property
def contact_person(self):
raise NotImplementedError()

@contact_person.setter
def contact_person(self, value):
raise NotImplementedError()