jfinkels / flask-restless

NO LONGER MAINTAINED - A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.
https://flask-restless.readthedocs.io
GNU Affero General Public License v3.0
1.02k stars 301 forks source link

Mongodb supported example? #660

Open scheung38 opened 7 years ago

scheung38 commented 7 years ago

Hi, does this support mongodB ?

from flask_restless import APIManager

app = Flask(__name__)
app.config.from_object('config')
# db = SQLA(app)
dbmongo = MongoEngine(app)
# appbuilder = AppBuilder(app, db.session)
appbuilder = AppBuilder(app, security_manager_class=SecurityManager)

api_manager = APIManager(app, flask_sqlalchemy_db=dbmongo)
api_manager.create_api(Activities, methods=['GET', 'POST', 'DELETE', 'PUT'])
api_manager.create_api(Projects, methods=['GET', 'POST', 'DELETE', 'PUT'])

Not sure if this is valid?

jasonrhaas commented 7 years ago

I would say it definitely does not. This module is for relational databases, ie SQLite, MySQL, MariaDB, etc. Mongo DB does not fit into this category.