-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
86 lines (80 loc) · 1.89 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
API_NAME = 'TIME TRACK API'
PAGINATION = False
PAGINATION_LIMIT = 100
PAGINATION_DEFAULT = 100
HATEOAS = False
IF_MATCH = False
DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ"
MONGO_HOST = 'localhost'
MONGO_PORT = 5001
MONGO_DBNAME = 'apitest'
projects = {
'item_title': 'project',
'cache_control': 'max-age=10,must-revalidate',
'cache_expires': 10,
'resource_methods': ['GET', 'POST'],
'item_methods': ['GET', 'PATCH', 'DELETE'],
'schema': {
'name': {
'type': 'string',
'required': True
},
'asana':{
'type': 'dict',
'schema': {
'id': {'type': 'number'},
'created_at': {'type': 'datetime'},
'modified_at': {'type': 'datetime'},
'archived': {'type': 'boolean'},
}
},
'basecamp_id': {
'type': 'string'
}
}
}
tasks = {
'item_title': 'task',
'cache_control': 'max-age=10,must-revalidate',
'cache_expires': 10,
'resource_methods': ['GET', 'POST'],
'item_methods': ['GET', 'PATCH', 'DELETE'],
'schema': {
'name': {'type': 'string', 'required': True},
'project': {
'type': 'objectid',
'required': True,
'data_relation': {
'resource': 'projects',
'field': '_id',
'embeddable': False
}
},
'parent_id': {
'type': 'objectid',
'data_relation': {'resource': 'task'}
},
'asana': {
'type': 'dict',
'schema': {
'id': {'type': 'number'},
'created_at': {'type': 'datetime'},
'completed': {'type': 'boolean'},
'completed_at': {'type': 'datetime'},
'modified_at': {'type': 'datetime'},
}
},
'basecamp_id': {'type': 'string'},
'time':{
'type': 'list',
'schema': {
'notes' : {'type': 'string'},
'time': {
'required': True,
'type': 'float'
}
}
}
}
}
DOMAIN = {'projects': projects, 'tasks': tasks}