Re: [sqlalchemy] DefaultClause

2015-01-12 Thread Michael Bayer
Jose Soares wrote: > I see, thus, this definition: >Column('abc', Unicode(20), server_default='abc') >Column('adef', Numeric(12,3), server_default=text('1.5')), > > is equivalent to this one: >Column('abc', Unicode(20), DefaultClause('abc')) >Column('def', Numer

Re: [sqlalchemy] DefaultClause

2015-01-12 Thread Jose Soares
I see, thus, this definition: Column('abc', Unicode(20), server_default='abc') Column('adef', Numeric(12,3), server_default=text('1.5')), is equivalent to this one: Column('abc', Unicode(20), DefaultClause('abc')) Column('def', Numeric(12,3), DefaultClause(text('1.

Re: [sqlalchemy] DefaultClause

2015-01-09 Thread Michael Bayer
you can use DefaultClause if you give it a text() object so that the quoting behavior is defined. server_default is a shortcut for that. jo wrote: > Do you suggest to use server_default instead of DefaultClause in all cases? > j > Il giorno giovedì 8 gennaio 2015 15:17:20 UTC+1, Michael Bayer

Re: [sqlalchemy] DefaultClause

2015-01-09 Thread jo
Do you suggest to use server_default instead of DefaultClause in all cases? j Il giorno giovedì 8 gennaio 2015 15:17:20 UTC+1, Michael Bayer ha scritto: > > use server_default with text() as documented at > http://docs.sqlalchemy.org/en/rel_0_9/core/defaults.html#server-side-defaults. > > > > >

Re: [sqlalchemy] DefaultClause

2015-01-08 Thread Michael Bayer
use server_default with text() as documented at http://docs.sqlalchemy.org/en/rel_0_9/core/defaults.html#server-side-defaults. jo wrote: > Hi all, > > I have a problem with DefautClause. I need to assign a default to a numeric > column. > tbl['rischio_attivita'] = Table('rischio_attivita'

[sqlalchemy] DefaultClause

2015-01-08 Thread jo
Hi all, I have a problem with DefautClause. I need to assign a default to a numeric column. tbl['rischio_attivita'] = Table('rischio_attivita', database.metadata, Column('id', Integer, Sequence('rischio_attivita_seq'), primary_key=True), Column('cod_attivita', Unicode(10),nul