Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created July 7, 2014 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/26a8ff2bbfe38bea32ef to your computer and use it in GitHub Desktop.
Save anonymous/26a8ff2bbfe38bea32ef to your computer and use it in GitHub Desktop.
import datetime
from pony.orm import *
db = Database('sqlite', 'data.sqlite', create_db=True)
class Base(db.Entity):
created = Optional(datetime.datetime, default=datetime.datetime.now)
class A(Base):
x = Optional(int)
y = Optional(int)
class B(Base):
y = Optional(int)
z = Optional(int)
db.generate_mapping(create_tables=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment