cobrateam / flask-mongoalchemy

Flask support for MongoDB using MongoAlchemy.
https://pythonhosted.org/Flask-MongoAlchemy/
BSD 2-Clause "Simplified" License
217 stars 45 forks source link

init_app() and save() respect safe argument (insert waits for a response) #19

Closed jeverling closed 13 years ago

jeverling commented 13 years ago

Changed MongoAlchemy.init_app so it takes app.config.get('MONGOALCHEMY_SAFE_SESSION', False) into account. This allows users to create a safe session. Also changed Document.save() to accept safe keyword. If safe==None (default), it will be set to Session.safe in mongoalchemy.

This is necessary if you have unique or sparse indexes.