manasgarg/flask-sauth

suggest split db-related stuff out

Closed this issue · 1 comments

would be very useful to lot more people if the db-related stuff (e.g. models and their usage) is separated into some class/interface and can be easily replaceable (with something else, be it sqlalchemy, couchdb, flat-file, or just diff.schema/naming)
also, remove the /accounts prefix in view route()s - let it stay as blueprint url_prefix.

it is usualy all the http-related Flow and stuff that is the pain to do again and again.

Svilen, for the model usage, it's not required for you to use mongodb. All the code imports "User" from models.py which is actually a LocalProxy to whatever you define as USER_MODEL_CLASS in your configuration. There is a sample code available for mongo (which is also the default) but you can define any User class that provides the same fields & methods.

Dependency on /accounts can be removed but it would be a backward incompatible change now and I don't think the pain is worth the gain.