eager_defaults wasn't much of an option until 0.9, might have to work around 
that issue for now.


On Oct 17, 2013, at 2:23 PM, Victor Varvariuc <victor.varvar...@gmail.com> 
wrote:

> I am using sqla 0.8
> 
> On Oct 17, 2013 8:46 PM, "Michael Bayer" <mike...@zzzcomputing.com> wrote:
> 
> On Oct 17, 2013, at 10:34 AM, Victor Varvariuc <victor.varvar...@gmail.com> 
> wrote:
> 
>> Ok, so the answer is to use 'eager_defaults': True :
>> 
>> class CommonBase(object):
>>     """Base model for Apilib db-mapped and virtual models.
>>     """
>>     __mapper_args__ = {
>>         # immediately fetch the value of server-generated default values 
>> after an INSERT or UPDATE
>>         'eager_defaults': True,
>>     }
>> 
>> Looks like it works, but in other models without columns with 
>> 'server_default' I am getting:
>> 
>>   File "../python2.7/site-packages/sqlalchemy/orm/query.py", line 2685, in 
>> _compile_context
>>     "No column-based properties specified for "
>> InvalidRequestError: No column-based properties specified for refresh 
>> operation. Use session.expire() to reload collections and related items.
> 
> I had observed this issue after my 0.9 based fixes and that should have been 
> fixed, what SQLA version are you using ?
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to