writing orm.py