I am developing an application using SQLAlchemy and wxPython, which I am trying to save in separate modules consisting of business logic, ORM and a graphical interface.
I'm not quite sure how to do this in a pythonic way.
Given that mapping() should be called in orther for the objects to be used, I thought about putting it in the __init__.py logic of the business process, but keeping all the table definitions in a separate orm.py module.
Should I store something like:
/Business /__init__.py | mapping (module1.Class1, orm.table1) | /module1.py Class1 /orm.py import table1 = Table() /GUI /main.py | import business /crud.py
or something like
/Business /__init__.py | import | /module1.py Class1 table1 = Table() mapping (module1.Class1, orm.table1) /GUI /main.py | import business /crud.py
Is the first approach recommended? Is there any other option? I saw the second way, but I donβt like to enter the database processing code and the business class logic code in one module. Am I overdoing it? Is this really not a problem?
python version-control sqlalchemy directory-structure
voyager
source share