Thomas Goirand bcb6991615 Fix genmodel for SQLA 0.9
Problem:
* Some python code was auto generated and exec'ed in that
package.
* The python code that was problematic had a 'Table' definition
* The generated code imports '*' from sqlalchemy
* One among the 'Column' was defined as an 'INTEGER' type, which
points to sqlalchemy.sql.sqltypes.INTEGER
* The INTEGER class was initialised with a parameter display_width
which contradicts with sqlalchemy.sql.sqltypes.INTEGER.__init__,
which does not accept any parameters
* The 'INTEGER' class should have been imported from mysql dialects'
type module
Solution:
* While generating, in the header part, I am now checking if any of
the column.type.__class__.__name__ has 'dialects' in it.
* If I find any, I am adding the import rule such that the type is
imported from the dialects' type.

This patch has been tested with SQLA 0.9.3, for which it fixes the
unit tests, and with SQLA 0.8.2, which doesn't have (new) problems
with this patch.

Change-Id: Ie0e09b45388462629100017bea3ea8a314d148d8
2014-03-05 06:55:25 -05:00
..
2009-06-30 22:50:18 +02:00
2011-10-02 20:13:10 +08:00
2014-03-05 06:55:25 -05:00
2010-09-12 13:29:17 +02:00
2014-02-17 07:17:31 -08:00