(to be continued) * DAOs define object-relational mapping (ORM) from native schema to Model. * They contain methods for translating user arguments into queries to native db. * The python module, SQLalchemy, supports ORMs and can accommodate different db environments (e.g. MSSQL, SQLite, etc)
To Make a New DAO:
(In progress) This example shows how to write a new dao for a simple three-table database. The dao can be found under the folder, ‘examplesbarebones’ in ‘swtoolsWOFpy’. The database contains data from the Lake Champlain Monitoring Program (LCM) from the Vermont Department of Environmental Conservation. The original data were in a collection of ASCII and MS Excel files. These were imported into a sqlite database for publishing through WOFpy. Please note that data is for demonstration purposes and has been modified slightly to make the tutorial clearer.
The three tables are sampling_sites, variables and LCM_data. Information on the source are contained in a .cfg file. Despite its simplicity, the database supports all four WaterOneFlow methods.