Skip to content

schematics/schemalchemy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SchemAlchemy

Schematics + SQLAlchemy

Usage

  1. Import schemalchemy (before schematics)
  2. Inherit from schemalchemy Base
  3. Define the SQLAlchemy columns (or provide a Table)
  4. Define the Schematics fields

Note: Column property names must be '_' + field_name (see about SQLAlchemy column_prefix if you need to customize the prefix).

Example

from schemalchemy import Base
from schematics.types import IntType, StringType
from sqlalchemy import Column, Integer, String


class Person(Base):

    __tablename__ = 'person'

    _id = Column('id', Integer, primary_key=True)
    _name = Column('name', String(50))

    id = IntType(default=1)
    name = StringType()

About

SchemAlchemy = Schematics + SQLAlchemy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages