Re: [sqlalchemy] Mixins and lazy (query) attributes

2019-06-06 Thread Christian Barra
Il giorno mercoledì 5 giugno 2019 18:17:48 UTC+2, Mike Bayer ha scritto: > > > > On Wed, Jun 5, 2019, at 12:02 PM, Christian Barra wrote: > > Hi, I am trying to understand what the best approach is to have lazy > attributes defined on a mixin and then used them on the su

[sqlalchemy] Mixins and lazy (query) attributes

2019-06-05 Thread Christian Barra
Hi, I am trying to understand what the best approach is to have lazy attributes defined on a mixin and then used them on the subclasses. Ideally I'd would like to defer the load of that attribute (controller) and use `undefer` when I know that that attribute is needed, to execute only one

Re: [sqlalchemy] Error while using return_defaults with insert

2017-03-21 Thread Christian Barra
= await result.scalar() Il giorno mercoledì 15 marzo 2017 14:37:29 UTC+1, Mike Bayer ha scritto: > > that's not SQLAlchemy, you're using this: > > https://github.com/aio-libs/aiopg/blob/master/aiopg/sa/result.py#L205 > > > > > On 03/15/2017 04:13 AM, Christian Barra wro

[sqlalchemy] Error while using return_defaults with insert

2017-03-15 Thread Christian Barra
Hello, I am trying to fetch the result of a query after an insert. SQLAlchemy 1.16 and PostgreSQL 9.6 This is the code: engine = self.request.app['db'] async with engine.acquire() as conn: query = models.User.insert().values(email=email, first_name= first_name,