-
Notifications
You must be signed in to change notification settings - Fork 4
/
data.py
29 lines (26 loc) · 910 Bytes
/
data.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
from mongoengine import *
from datetime import datetime
from mongoenginepagination import Document
import os
if os.getenv('USE_MLAB'):
connect('heroku_app8846523', host=os.getenv('MONGOLAB_URI', 'mongodb://localhost:27017'))
else:
connect('sandy', host='hydr0.com') #Dev server
class Request(Document):
name = StringField()
request = StringField()
location = StringField()
contact = StringField()
urgent = BooleanField()
time = DateTimeField(default=datetime.now)
responses = ListField(ReferenceField('FollowUp'))
valid = BooleanField(default=True)
connected = BooleanField(default=False)
class FollowUp(Document):
name = StringField()
cangive = StringField()
contact = StringField()
time = DateTimeField(default=datetime.now)
entry = ReferenceField(Request)
valid = BooleanField(default=False)
connected = BooleanField(default=False)