Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Review flask-mongokit #432

Closed
jarus opened this Issue Mar 12, 2012 · 5 comments

Comments

Projects
None yet
3 participants
Contributor

jarus commented Mar 12, 2012

In my eyes flask-mongokit fulfil all requirements for a aproved extension.
Please review.

Thanks

PS: It is already listed under extensions.

Contributor

jarus commented Jul 8, 2012

There was a update of Flask-MongoKit which use the new cool app_context and it should be a good example of usage for other extension developers so it would be great to be a approved extension.

Christoph

Contributor

methane commented Jan 27, 2013

https://github.com/jarus/flask-mongokit/blob/master/flask_mongokit.py#L140

I think .init_app(app) should not set self.app = app.
For example:

from flask import Flask
from flask.ext.mongokit import MongoKit

main_app = Flask(__name__)
mongo = MongoKit(main_app)

admin_app = Flask(__name__)
mongo.init_app(admin_app)

In this case, mongo should use main_app when out of context.

See also: https://github.com/mitsuhiko/flask-sqlalchemy/blob/master/flask_sqlalchemy.py#L783

Contributor

jarus commented Jan 29, 2013

Thanks for this hint. I'm not 100% sure if you have a context than the extension should use the app of the context and is there no context than it should use the defined app, right?

Jarus

@jarus jarus referenced this issue in jarus/flask-mongokit Jan 29, 2013

Open

Improve app context handling #14

Contributor

methane commented Jan 30, 2013

@jarus http://flask.pocoo.org/docs/extensiondev/#initializing-extensions doesn't mention about fallbacking to default app.
But if extension has some feature they don't require app_context, allowing to use them outside of context is helpful.

Owner

untitaker commented Oct 19, 2014

please refile against https://github.com/pocoo/metaflask

@untitaker untitaker closed this Oct 19, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment