Skip to content

Instantly share code, notes, and snippets.

@agronholm
Created March 13, 2012 22:27
Show Gist options
  • Save agronholm/2032214 to your computer and use it in GitHub Desktop.
Save agronholm/2032214 to your computer and use it in GitHub Desktop.
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import *
Base = declarative_base()
class Foo(Base):
__tablename__ = 'foo'
id = Column(Integer, primary_key=True)
for i in range(32):
setattr(Foo, 'bin-%d' % i, Column(Integer))
engine = create_engine('sqlite:///', echo=True)
Base.metadata.create_all(engine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment