[sqlalchemy] Re: Get default value

2008-01-11 Thread Alexandre da Silva
Em Sex, 2008-01-11 às 08:54 +0200, [EMAIL PROTECTED] escreveu: either put the correct polymorphic_on=resource.c.poly, or remove it alltogether, it comes from the inherited base-mapper. Exactly, works fine leaving poly on resource and mapping all polymorphic_on=resource.c.poly cookbook

[sqlalchemy] Re: Get default value

2008-01-10 Thread Rick Morrison
Isn't it just column.default ? --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: Get default value

2008-01-10 Thread Rick Morrison
Ah, I read too fast, you are getting back the ColumnDefault object try column.default.arg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] Re: Get default value

2008-01-10 Thread jason kirtland
Alexandre da Silva wrote: Hello all, is there a way that I can get the default value defined on Column(default=something) ? the default I get is a ColumDefault, and I don't know how to get it's value. any suggestion? The value is in its .arg property: col.default.arg

[sqlalchemy] Re: Get default value

2008-01-10 Thread Alexandre da Silva
Em Qui, 2008-01-10 às 17:13 -0800, jason kirtland escreveu: col.default.arg Yes, exactly this. another question How many levels I can inherit classes/tables without get something wrong? let me show a simplest sample hierarchy: resource / \

[sqlalchemy] Re: Get default value

2008-01-10 Thread Rick Morrison
You're mixing single-table inheritance (using the discriminator column), with concrete inheritance (using multiple tables). You have to pick one scheme or the other. Either use a single inheritance chain, or separate the two class hierarchies into two separate chains that don't inherit from each

[sqlalchemy] Re: Get default value

2008-01-10 Thread Alexandre da Silva
Em Qui, 2008-01-10 às 21:20 -0500, Rick Morrison escreveu: You're mixing single-table inheritance (using the discriminator column), with concrete inheritance (using multiple tables). You have to pick one scheme or the other. Either use a single inheritance chain, or separate the two class

[sqlalchemy] Re: Get default value

2008-01-10 Thread Alexandre da Silva
Em Qui, 2008-01-10 às 21:20 -0500, Rick Morrison escreveu: You're mixing single-table inheritance (using the discriminator column), with concrete inheritance (using multiple tables). You have to pick one scheme or the other. Either use a single inheritance chain, or separate the two class

[sqlalchemy] Re: Get default value

2008-01-10 Thread sdobrev
How many levels I can inherit classes/tables without get something wrong? my tests go to 4, all works. And as all corner cases are already there, i guess any level above will work too. mixed inheritance (joined+concrete) also can be made to work, as long as polymoprhic_union() is fixed