The ORM should be enhanced to make for easier maintenance and debugging.
Implementation details for refactoring the existing ORM:
- ORMColumn to SQL generation and event hooks is sloppy as hell. This needs to be refactored to place these bits in the Column classes
- Column names in the generated SQL need to be translatable to their respective model within a join, such that they can be individually referenced from where={}. Example: {'model.colname'='foobar'} can translate to "where model_colname = %(foobar)s"
- SQL generation can be further refined by the use of "prepared statements", since SQL generation currently happens at request time.
- The Formatter class needs to be factored away to a more generic interface, supported by the formatter methods that currently reside in model.py
- Look into object caching to accelerate ORMRelation and load() behavior (if needed)