-
-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user-specified Model base classes #72
Conversation
+1 |
7 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
-1
if you needed the db.Model inside the Base, that's a different thing. |
agree with @jamesonjlee . 👎 |
Extending this to allow other custom bases such as DeclarativeMeta, BaseQuery, etc. would be really useful. Right now I end up subclassing and overriding the extension to use custom classes. |
👍 - this would still be increadibly useful and avoid nasty monkeypatching! Using mixins instead is not a very good idea. You need to put them in every single model explictly even if you just want to add convenience methods which you do want in all your models. |
This is in response to issue #62. It allows a user to specify a base class for models (which should be a subclass of
flaskext.sqlalchemy.Model
) in the constructor offlaskext.sqlalchemy.SQLALchemy
. Note: this does not work with theSQLAlchemy.init_app(app)
idiom unless the model class is specified in the constructor ofSQLAlchemy
.