Skip to content

Instantly share code, notes, and snippets.

Created July 7, 2014 22:43
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/e70f7aebacea9e97ff90 to your computer and use it in GitHub Desktop.
Save anonymous/e70f7aebacea9e97ff90 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 X(Base):
x = Optional(int)
class Y(Base):
y = Optional(int)
class Z(Base):
z = Optional(int)
class A(X, Y):
pass
class B(Y, Z):
pass
db.generate_mapping(create_tables=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment