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