Skip to main content

Simple ORM BaseModel for Flask depends on SqlAlchemy

Project description

pyco-sqlalchemy

  • Base On SqlAlchemy, according to regular web sevices, encapsulate A interface class(CoModel), expanded the APIs for CURD, which makes SqlAlchemy's ORM even simpler for humans, support with Flask/Django/OtherWebFrames.

Release:

GitCommit=5acf9fca45f5026a8826a564e85944d4bea24dea
PublishAt=2024-06-17 22:22
PublishVersion=1.2.9

基于`sqlalchemy`, 基于web常规业务,封装接口类`CoModel`,提供自定义的通用接口。

Usage Samples:

from pyco_sqlalchemy._flask import BaseModel, db


class User(db.Model, BaseModel):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    name = db.Column(db.String(32))
    email = db.Column(db.String(64), unique=True)


form = dict(name="dev")
u1 = User.insert(form, email="dev@pypi.com")
u3 = User.upsert_one(form, email="dev@oncode.cc")
assert u1.id == u3.id

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

pyco_sqlalchemy-1.2.9.tar.gz (11.2 kB view hashes)

Uploaded Source

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