On Apr 15, 2010, at 7:26 AM, Michael Brickenstein wrote:

> 
> 
> On 15 Apr., 13:03, Michael Brickenstein <[email protected]> wrote:
>> Sorry, forgot to mention, I had the same behaviour with SA 0.5.6 and
>> 0.5.8.
>> Cheers,
> 
>>> In former times, I used
>>> prop.server_default to find out, that there is an default of ''.
> Sorry, that's wrong it has always been the columns[0], that I have to
> inspect.
> Nevertheless, the question for an official way remains, so far the
> situation is the following:
> c.server_default
> -> None
> 
> c2=iter(c.base_columns).next()
> -> DefaultClause(<sqlalchemy.sql.expression._TextClause object at
> 0xa2507ac>, for_update=False)
> 
> Is that a bug or a feature?


server_default is where we put whatever server side defaults were detected 
during reflection.   They reflect as a sqlalchemy.schema.DefaultClause, "arg" 
is a TextClause representing what was received, and calling str() on that gives 
you the ultimate value.    The TextClause is so that we can differentiate it 
from a literal python-defined value that would require quoting.


-- 
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.

Reply via email to