Hi.
In SQLAlchemy 0.3.10 ( / Python2.5), I found that YEAR column type is
created as TEXT column type in the following simple create query:
-------------------------------------------
from sqlalchemy import *
from sqlalchemy.databases.mysql import *
db = create_engine("mysql://[EMAIL PROTECTED]/test")
metadata = MetaData(db)
year_table = Table("year_table", metadata,
Column("y", MSYear)
)
year_table.create()
--------------------------------------------

I read the source and find it seems MSYear's get_search_list() method
returns a sequence of (TEXT, MSYear, String, TypeEngine,
AbstractType).In this case,  the first item, Text, is used.

I'm not familiar with the SQLAlchemy's whole archtecture, so now I'm
avoiding this problem adding get_search_list() method in MSYear like
this:
------------------------------------------
class MSYear(sqltypes.String):
    """MySQL YEAR type, for single byte storage of years 1901-2155"""

    def get_col_spec(self):
        if self.length is None:
            return "YEAR"
        else:
            return "YEAR(%d)" % self.length

    def get_search_list(self):
        return [self.__class__]
------------------------------------------
I think this should be fixed in proper manner.

Regards,

Hiroshi Ayukawa


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to