Skip to main content

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

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.

Files for Flask-ActiveRecord, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size Flask-ActiveRecord-0.2.tar.gz (6.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page