Start to add ORM classes for MediaWiki and Winterrodeln tables.
[philipp/winterrodeln/wrpylib.git] / wrpylib / wrorm.py
1 """
2 Usage:
3 >>> import sqlalchemy.orm
4 >>> import sqlalchemy.engine
5 >>> engine = sqlalchemy.engine.create_engine('mysql://philipp@localhost:3306/philipp_winterrodeln_wiki?charset=utf8&use_unicode=1')
6 >>> Session = sqlalchemy.orm.sessionmaker(bind=engine)
7 >>> session = Session()
8 """
9 import sqlalchemy.orm
10 import wrpylib.mwdb
11 import wrpylib.wrmwdb
12
13
14 class Page:
15     pass
16
17
18 class WrIntermapsSledrun:
19     pass
20
21
22 metadata = sqlalchemy.schema.MetaData()
23 wrintermapssledrun_table = wrpylib.wrmwdb.wrintermapssledrun_table(metadata)
24 page_table = wrpylib.mwdb.page_table(metadata)
25
26 sqlalchemy.orm.mapper(WrIntermapsSledrun, wrintermapssledrun_table)
27 sqlalchemy.orm.mapper(Page, page_table)