#31 sqlType ignored for StringCol columns

closed-fixed
nobody
None
5
2004-08-18
2004-07-07
Anonymous
No

StringCol ignores the sqlType argument because it gets
overridden by its own type-selection logic.

This patch makes StringCol always use the sqlType if
specified.

Discussion

  • Logged In: YES
    user_id=366194

    Hm, the patch didn't seem to stick. Anyway, here it is - it
    should be fairly obvious even after whitespace mangling:

    diff -puN sqlobject/col.py~stringcol-sqltype sqlobject/col.py
    --- SQLObject/sqlobject/col.py~stringcol-sqltype
    2004-07-07 11:46:25.927588481 -0700
    +++ SQLObject-jeremy/sqlobject/col.py 2004-07-07
    11:47:46.660114103 -0700
    @@ -297,7 +297,9 @@ class SOStringCol(SOCol):
    return constraints

    def _sqlType(self):
    - if not self.length:
    + if self.customSQLType is not None:
    + return self.customSQLType
    + elif not self.length:
    return 'TEXT'
    elif self.varchar:
    return 'VARCHAR(%i)' % self.length

    _

     
  • Ian Bicking
    Ian Bicking
    2004-08-18

    • status: open --> closed-fixed