mongoalchemy flask

Solutions on MaxInterview for mongoalchemy flask by the best coders in the world

showing results for - "mongoalchemy flask"
Valeria
10 Apr 2018
1from flask import Flask
2from flask.ext.mongoalchemy import MongoAlchemy
3app = Flask(__name__)
4app.config['MONGOALCHEMY_DATABASE'] = 'library'
5db = MongoAlchemy(app)
6
7class Author(db.Document):
8    name = db.StringField()
9
10class Book(db.Document):
11    title = db.StringField()
12    author = db.DocumentField(Author)
13    year = db.IntField()
14
Jorge
14 Feb 2018
1$ [sudo] pip install Flask-MongoAlchemy
2
queries leading to this page
flask mongodbmongoalchemy flask