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))
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.3.tar.gz.
File metadata
- Download URL: Flask-ActiveRecord-0.2.3.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3e8d73c5d1be0f142debbce8f94fe27fa57b75d05e81e1344ebd62b0163a77b
|
|
| MD5 |
c393335cceb95dc8889209e92969a840
|
|
| BLAKE2b-256 |
7f9addd4d25e877b6cef93ed56910612061ae95e9af75096b470b5b27b941508
|