yeah, `remove` is just a better way to handle scoped sessions. I should
really move to regular sessions like you; I keep forgetting that I have
these old legacy scoped sessions for no reason.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To
> On 28 Oct 2016, at 21:47, Jonathan Vanasco wrote:
>
> oh great! `session.info["request"]` solved all my problems quite nicely. i
> integrated that my pipy sessions manager.
>
> Simon, thanks. Looking at your code, I recall that `dbsession.remove()` may
> be better than
oh great! `session.info["request"]` solved all my problems quite nicely. i
integrated that my pipy sessions manager.
Simon, thanks. Looking at your code, I recall that `dbsession.remove()` may
be better than `dbsession.close()`
On 10/28/2016 11:55 AM, Kent Bower wrote:
The load() event would also capture if it were subqueryload()ed, right?
any eagerload.
And overriding Query.__iter__ wouldn't catch the cases where the scalar
is a "use_get" lookup that was already in session.identity_map...
right, would need
The load() event would also capture if it were subqueryload()ed, right?
And overriding Query.__iter__ wouldn't catch the cases where the scalar is
a "use_get" lookup that was already in session.identity_map... No good way
to intercept attributes.set_committed() for that, is there?
On Fri, Oct
On 10/28/2016 10:48 AM, Kent wrote:
@validates and 'set' attribute events will only fire when the /user/
sets a property (setattr), not when initially loaded by the orm.
Is there a way to intercept (for inspection) a scalar relationship
property instance when it is loaded? I don't think the
I've changed the assertions to all expect "3" items since assertions
should illustrate what's expected to happen (this again communicates to
me what the problem is).
Applying expire() to all three (plus reassignment in the first case)
allows them all to work. If you don't expire the
@validates and 'set' attribute events will only fire when the *user* sets a
property (setattr), not when initially loaded by the orm.
Is there a way to intercept (for inspection) a scalar relationship property
instance when it is loaded? I don't think the 'load' event will work
because I
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
atob = Table(
'atob', Base.metadata,
Column('aid', ForeignKey('a.id'), primary_key=True),
Column('bid', ForeignKey('b.id'), primary_key=True)
)
On 10/28/2016 09:13 AM, Colton Allen wrote:
Okay I see. That does remove the error. But I am having trouble saving
the relationship. Check the example code. It is much clearer than I am.
I can't tell you why the code works or doesn't, at this level I need to
run it.
I will re-assemble
Okay I see. That does remove the error. But I am having trouble saving
the relationship. Check the example code. It is much clearer than I am.
If I query a new set of items or specify an item model instance it will
save perfectly. But all of the instances in the instrumented list will not
On Fri, Oct 28, 2016 at 3:19 AM, mike bayer wrote:
>
>
> On 10/27/2016 09:41 PM, Jonathan Vanasco wrote:
>>
>> I have an edge-case in a few situations where, within an @property of a
>> SqlAlchemy object, I need to know the current active web-request/context.
>>
>> I'm
12 matches
Mail list logo