|
a |
|
b/qiita_db/investigation.py |
|
|
1 |
""" |
|
|
2 |
Objects for dealing with Qiita studies |
|
|
3 |
|
|
|
4 |
This module provides the implementation of the Investigation class. |
|
|
5 |
|
|
|
6 |
|
|
|
7 |
Classes |
|
|
8 |
------- |
|
|
9 |
- `Investigation` -- A Qiita investigation class |
|
|
10 |
""" |
|
|
11 |
# ----------------------------------------------------------------------------- |
|
|
12 |
# Copyright (c) 2014--, The Qiita Development Team. |
|
|
13 |
# |
|
|
14 |
# Distributed under the terms of the BSD 3-clause License. |
|
|
15 |
# |
|
|
16 |
# The full license is in the file LICENSE, distributed with this software. |
|
|
17 |
# ----------------------------------------------------------------------------- |
|
|
18 |
|
|
|
19 |
import qiita_db as qdb |
|
|
20 |
|
|
|
21 |
REQUIRED_KEYS = {"name", "description", "contact_person"} |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
class Investigation(qdb.base.QiitaObject): |
|
|
25 |
""" |
|
|
26 |
Study object to access to the Qiita Study information |
|
|
27 |
|
|
|
28 |
Attributes |
|
|
29 |
---------- |
|
|
30 |
name: str |
|
|
31 |
name of the investigation |
|
|
32 |
description: str |
|
|
33 |
description of what the investigation is investigating |
|
|
34 |
contact_person: StudyPerson object |
|
|
35 |
studies: list of Study Objects |
|
|
36 |
all studies that are part of the investigation |
|
|
37 |
|
|
|
38 |
Methods |
|
|
39 |
------- |
|
|
40 |
add_study |
|
|
41 |
Adds a study to the investigation |
|
|
42 |
""" |
|
|
43 |
_table = "investigation" |
|
|
44 |
|
|
|
45 |
@classmethod |
|
|
46 |
def create(cls, owner, info, investigation=None): |
|
|
47 |
"""Creates a new investigation on the database""" |
|
|
48 |
raise NotImplementedError() |
|
|
49 |
|
|
|
50 |
@classmethod |
|
|
51 |
def delete(cls, id_): |
|
|
52 |
"""Deletes an investigation on the database""" |
|
|
53 |
raise NotImplementedError() |
|
|
54 |
|
|
|
55 |
@property |
|
|
56 |
def name(self): |
|
|
57 |
raise NotImplementedError() |
|
|
58 |
|
|
|
59 |
@name.setter |
|
|
60 |
def name(self, value): |
|
|
61 |
raise NotImplementedError() |
|
|
62 |
|
|
|
63 |
@property |
|
|
64 |
def description(self): |
|
|
65 |
raise NotImplementedError() |
|
|
66 |
|
|
|
67 |
@description.setter |
|
|
68 |
def description(self, value): |
|
|
69 |
raise NotImplementedError() |
|
|
70 |
|
|
|
71 |
@property |
|
|
72 |
def contact_person(self): |
|
|
73 |
raise NotImplementedError() |
|
|
74 |
|
|
|
75 |
@contact_person.setter |
|
|
76 |
def contact_person(self, value): |
|
|
77 |
raise NotImplementedError() |