On Jul 30, 2007, at 2:26 PM, Jonathan Ballet wrote:

> No, after a flush(), everything is fine.
> However, I would like to have the default value _before_ flush()-ing.
>
> Hmm, after thinking about it a few more minutes, it would be a bit
> restrictive, since it will work only for 'scalar' values :/

yes, figured that.  The issues with this are that it would not be  
consistently available; it could only work for Python-side defaults,  
and could also only work for defaults that do not require an  
ExecutionContext (i.e. the full set of parameters being passed to the  
INSERT statement).   The usage model with SA, and especially in 0.4,  
is that data can be flushed anytime...no need to wait for some  
special time to flush.  with that model, your defaults are availble  
in all cases the way youd want them.

Also if you really need the "False" before any flush occurs, you  
might want to define that in the __init__ method of your mapped class  
as well.  If you create an external function called my_table_default 
(), the same function can be placed within your Table def as well as  
your class's __init__ method.

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