<div dir="ltr"><div><div>Thanks for the reply.</div></div><div><br></div><div>I am sure I violated bunch of rules in this approach but "users are stupid" is in my opinion the first rule in software development.</div>
<div><br></div><div>Full disclosure:</div><div><br></div><div>What I did was this.</div><div><br></div><div>I used sqlacodengen and ran it towards the database schema (yes I am lazy) . </div><div>It produces the classes automatically but with SQLAlchemy syntax.</div>
<div><br></div><div>I then wrote a small script to translate the syntax to pony.orm'ish.</div><div><br></div><div>The result is as an example below.</div><div><br></div><div>class Customer(db.Entity):</div><div> _table_ = 'customers'</div>
<div><br></div><div> pk = PrimaryKey(int, auto=True)</div><div> name = Optional(unicode)</div><div> natid = Required(int)</div><div> address = Optional(unicode)</div><div> address2 = Optional(unicode)</div>
<div> state = Optional(unicode)</div><div> zip = Optional(unicode)</div><div> city = Optional(unicode)</div><div> phone = Optional(int)</div><div> billing_contact = Optional(unicode)</div><div> sysadmin = Optional(unicode)</div>
<div> active = Optional(int, default=1)</div><div> site = Set("Sites")</div><div> person = Set("Persons")</div><div><br></div><div>I generally prefer to create my database schema myself using naming conventions like PK for Primary keys and fk_<table></div>
<div>as the first columns if applicable. Create sequences and insert triggers because so many things come free that way.</div><div><br></div><div>This time I finished writing the app and used cx_Oracle direct with the associating, painstaking finger work. </div>
<div><br></div><div>I will get around to test this better soon but I wish sqlcodegen had "--pony.orm" arg. It wold make life so much easier . :-)</div><div><br></div><div>Kind regards,</div><div>Bjarni</div><div>
<br></div></div>