On Dec 21, 2007, at 2:10 PM, Christophe de VIENNE wrote:
> > 2007/12/21, Michael Bayer <[EMAIL PROTECTED]>: >>> In the HEAD version, the table creation does not set the default >>> values on the columns (tested on mysql and mssql) >>> It seems that the function SchemaGenerator.get_column_default_string >>> (in compiler.py) always returns None, even if a default value is >>> specified. >>> >>> 801 def get_column_default_string(self, column): >>> 802 if isinstance(column.default, schema.PassiveDefault): >>> 803 if isinstance(column.default.arg, basestring): >>> 804 return "'%s'" % column.default.arg >>> 805 else: >>> 806 return unicode(self._compile(column.default.arg, >>> None)) >>> 807 else: >>> 808 return None >>> >> >> ColumnDefaults are "in-python" default generators, they dont get >> rendered into DDL. PassiveDefault is used to produce a DDL-rendered >> default: >> >> http://www.sqlalchemy.org/docs/04/metadata.html#metadata_defaults_passive >> > > What is really disturbing is that Column(..., PassiveDefault(u'N')) > and Column(..., default=PassiveDefault(u'N')) don't have the same > behavior. default=<SomeDefaultGenerator> should really be fixed to do something meaningful, I know. we'll fix that. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
