-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodels.py
More file actions
29 lines (23 loc) · 771 Bytes
/
models.py
File metadata and controls
29 lines (23 loc) · 771 Bytes
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 flask import Flask
from flask_mongoalchemy import MongoAlchemy
app = Flask(__name__)
app.config['MONGOALCHEMY_DATABASE'] = 'saiop'
app.config['MONGOALCHEMY_CONNECTION_STRING'] = 'mongodb://admin:freeflow@ds135760.mlab.com:35760/saiop'
db = MongoAlchemy(app)
class User(db.Document):
name = db.StringField()
email = db.StringField()
password = db.StringField()
type = db.StringField()
class Journal(db.Document):
title = db.StringField()
user_email = db.StringField()
domain = db.StringField()
status = db.StringField()
filename = db.StringField()
date = db.DateTimeField()
class Comments(db.Document):
user = db.StringField()
commenter = db.StringField()
title = db.StringField()
desc = db.StringField()