ActiveRecord support for Flask-SQLAlchemy models
Project description
ActiveRecord support for Flask-SQLAlchemy models
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.activerecord import patch_model
# patch model first
patch_model()
app = Flask(__name__)
db = SQLAlchemy(app)
# example model
class User(db.Model):
__attribute_filters__ = {
'accessible': ('fullname', 'country'),
'protected': ('id', 'email', 'password')
'hidden': ('password', )
}
email = db.Column(db.String, unique=True)
password = db.Column(db.String, unique=True)
fullname = db.Column(db.String)
country = db.Column(db.String(2))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Flask-ActiveRecord-0.2.tar.gz
.
File metadata
- Download URL: Flask-ActiveRecord-0.2.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d242f29b2feabdfdd066a7b6002ad6b125836ccce0e223ff5c06e3d067300e0 |
|
MD5 | 3093a3f2faae55e16f40265e6cb7e868 |
|
BLAKE2b-256 | f1afe144e1f069b7d9c940e425b981084eae6ad20bbb2626cea42f7c2eaea401 |