Skip to content

Commit 2f4f530

Browse files
committed
first cut of orm, orderlines only [sqlalchemy_classical_mapper]
1 parent 207cb6c commit 2f4f530

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ dist: xenial
22
language: python
33
python: 3.8
44

5+
install:
6+
- pip3 install sqlalchemy
7+
58
script:
69
- make test
710

orm.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from sqlalchemy import Table, MetaData, Column, Integer, String
2+
from sqlalchemy.orm import mapper
3+
4+
import model
5+
6+
7+
metadata = MetaData()
8+
9+
order_lines = Table(
10+
'order_lines', metadata,
11+
Column('orderid', String(255), primary_key=True),
12+
Column('sku', String(255), primary_key=True),
13+
Column('qty', Integer),
14+
)
15+
16+
17+
def start_mappers():
18+
mapper(model.OrderLine, order_lines)

0 commit comments

Comments
 (0)