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

Using Connection String URI Format #40

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi,

Is that possible to add the Standard Connection String Format (http://docs.mongodb.org/manual/reference/connection-string/#standard-connection-string-format)

I am writing this issue at http://stackoverflow.com/questions/29030257/flask-mongoalchemy-with-multi-hosts-urls

Cheers

fsouza commented 9 years ago

Hi @daknightproductions, currently it is not, but it's quite easy to do so. Do you wanna send a patch?

Currently, the code builds the URI from the configuration parameters [1]. We can add a new configuration parameter for the URI, and then the code won't need to build it.

[1] https://github.com/cobrateam/flask-mongoalchemy/blob/master/flask_mongoalchemy/__init__.py#L22:L50

ghost commented 9 years ago

Hey there,

Well of course it's easy to hack it but i think it's nice to let other people to have it too, especially if we use pip install. If you have time in the future, please add 1 extra param which take a whole uri and just return it if it is not empty....or something better :)

Cheers

Många varma kramar Oai Gudmundsson

http://daknight.se Web Dev 3.0 Oai Gudmundsson +46812061700

On Tue, Mar 17, 2015 at 2:57 AM, Francisco Souza notifications@github.com wrote:

Hi @daknightproductions https://github.com/daknightproductions, currently it is not, but it's quite easy to do so. Do you wanna send a patch?

Currently, the code builds the URI from the configuration parameters [1]. We can add a new configuration parameter for the URI, and then the code won't need to build it.

[1] https://github.com/cobrateam/flask-mongoalchemy/blob/master/flask_mongoalchemy/__init__.py#L22:L50

— Reply to this email directly or view it on GitHub https://github.com/cobrateam/flask-mongoalchemy/issues/40#issuecomment-82030128 .

fsouza commented 9 years ago

Sure, I will do it later today. Thanks for reporting it!

fsouza commented 9 years ago

It's fixed and released, please upgrade to the version 0.7.1.

Thanks for reporting!

ghost commented 9 years ago

Thank you very much! :)

Många varma kramar Oai Gudmundsson

http://daknight.se Web Dev 3.0 Oai Gudmundsson +46812061700

On Tue, Mar 17, 2015 at 5:04 PM, Francisco Souza notifications@github.com wrote:

It's fixed and released, please upgrade to the version 0.7.1.

Thanks for reporting!

— Reply to this email directly or view it on GitHub https://github.com/cobrateam/flask-mongoalchemy/issues/40#issuecomment-82435818 .