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
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

Flask-ActiveRecord-0.2.2.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file Flask-ActiveRecord-0.2.2.tar.gz.

File metadata

File hashes

Hashes for Flask-ActiveRecord-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d40b7989a5ca4e95d754864d09d9444ac0434c4e7785c8cceffdc095cebf2646
MD5 e1c4c071e4fe81c27d3baa4e16aaff2f
BLAKE2b-256 9ee9570561d1fcaf040019f6dc343a7442862c4f26fe57152a3e18318c9161c4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page