Excellent. As always, thanks very much for your time and answers (let
alone awesome software)!
On Wed, Jan 27, 2021 at 1:25 PM Mike Bayer wrote:
>
>
> On Tue, Jan 26, 2021, at 9:01 PM, Kent Bower wrote:
>
> Thanks a ton for your responses.
>
> Do all the normal column
uld that modify the compiled mappers for the entire
process... these are the things running through my head.)
On Tue, Jan 26, 2021 at 8:18 PM Mike Bayer wrote:
>
>
> On Tue, Jan 26, 2021, at 7:31 PM, Kent Bower wrote:
>
> I should have given these details from the get
anyway, or won’t this work?
On Tue, Jan 26, 2021 at 6:18 PM Mike Bayer wrote:
>
>
> On Tue, Jan 26, 2021, at 3:16 PM, Kent wrote:
>
> Question: if I add a mapper to a class that is only needed temporarily,
> does using the mapper compile it along side my "normal" mappers
my
"main mappers" and gets thrown away when the class is thrown away or is
that not possible?
Thanks in advance,
Kent
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and
ore
> warnings or conditions like this. the most important part is getting the
> test coverage in so as I refactor for 1.4 / 2.0 the behavioral contract is
> maintained. thanks!
>
>
>
> On Wed, May 13, 2020, at 1:16 PM, Kent Bower wrote:
>
> Very good, will do when I find tim
ts
> screwed up, the pool will warn and still make sure it does a real
> rollback.you should not see this warning however.
>
> in 2.0, the whole "reset" logic is simplified so that none of this
> complexity will be there.
>
>
>
> On Wed, May 13, 2020, at 11:5
elease today
>
>
>
> On Wed, May 13, 2020, at 11:51 AM, Mike Bayer wrote:
>
>
>
> On Wed, May 13, 2020, at 11:39 AM, Kent Bower wrote:
>
> In this script, conn.close() does *not *call rollback on the
> transaction. It isn't just a logging issue as I've verified from the
&g
ehaviors of
> Connection. So yes I would not be relying upon DBSession.close() as a
> means of transaction control if the session is bound to a connection
> directly. If the session is bound to a connection I would advise ensuring
> that connection is in a transaction on the outside that you ar
more complex, with zope.sqlalchemy &
transaction and frameworks; I boiled it down to this script for demo
purposes and removed those libraries, making this code look weirder.)
Thanks in advance!
Kent
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy
Excellent, thanks very much!
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You
Will
a.b1 = None
issue a delete statement that also contains the WHERE clause to make that
safe? (Or, is the delete always by primary key anyway?)
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE:
Thanks!
Kent
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message becau
Never mind that last silly 0.7 question. (Your patch is compatible it
seems.) (And pretend that you didn't hear any mention of 0.7)
Thanks again for your awesome software!
Kent
On Wednesday, September 13, 2017 at 3:42:55 PM UTC-4, Kent wrote:
>
>
>> dude!it is 2017. get on
w have easy to run Oracle, SQL
> Server, etc. databases anywhere I need them so I can quickly confirm
> that this works with ansi or not:
>
> mapper(Rock, rocks_table,
> properties={
> 'livingbugs': relationship(Bug,
> primaryjoin=and_(
>
ot;ON ..." clause instead of the "WHERE".
Alternatively, is there a hack I could use to fix the rendered SQL on
joinedloads for this particular relationship?
Thanks very much in advance!
Kent
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlal
t;>
>> the fix is not as obvious as that, that particular check is assuming a
>> column_property() where its value was never present in __dict__ in the
>> first place, so it needs to be marked "expired".
>>
>>
>> On 05/10/2017 01:38 PM, Kent wrot
lace, so it needs to be marked "expired".
>
>
> On 05/10/2017 01:38 PM, Kent wrote:
>
>> The regular columns seem to expire and reload properly without issue.
>> (Is that what you're asking?)
>>
>> You want me to submit a PR changing:
>>
>> if p.
, 2017 at 12:55:45 PM UTC-4, Mike Bayer wrote:
>
> so you can confirm this is only for custom SQL + column_property(), not
> a regular column right? definitely a bug for 1.2 if you can post it up
>
>
> On 05/10/2017 12:37 PM, Kent wrote:
> > I'm thinking that should be
&g
ike...@zzzcomputing.com>
wrote:
> so you can confirm this is only for custom SQL + column_property(), not a
> regular column right? definitely a bug for 1.2 if you can post it up
>
>
> On 05/10/2017 12:37 PM, Kent wrote:
>
>> I'm thinking that should be
>> *"if
I'm thinking that should be
*"if p.expire_on_flush and p.key in state.dict"*
On Wednesday, May 10, 2017 at 11:35:30 AM UTC-4, Kent wrote:
>
> deferred column_properties may be less-efficient subquery selects (and
> thus marked deferred). When a flush occurs that updates an
.dict"
?
Just wanted someone to look that code over again.
On Wednesday, May 10, 2017 at 11:35:30 AM UTC-4, Kent wrote:
>
> deferred column_properties may be less-efficient subquery selects (and
> thus marked deferred). When a flush occurs that updates an object, any
> read-o
Awesome!
I like the second approach better for the exact same reasons.
Thanks so much!
Kent
On Thursday, April 13, 2017 at 1:50:40 PM UTC-4, Mike Bayer wrote:
>
>
> it has nothing to do with joined table inheritance, in your example,
> your base mapper is al
-4, Mike Bayer wrote:
>
>
>
> On 04/13/2017 10:24 AM, Kent wrote:
> > Suppose we have the documentation's example of *Concrete Table
> > Inheritance, *where
> >
> > session.query(Employee).all()
> >
> >
> > pr
)) AS manager_data, engineers.name AS name,
engineers.engineer_info AS engineer_info, 'engineer' AS type
FROM engineers
) AS pjoin
Is there a way to accomplish this?
Thanks in advance,
Kent
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post
n Fri, Oct 28, 2016 at 11:21 AM, mike bayer <mike...@zzzcomputing.com>
wrote:
>
>
> 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.
>>
@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
I attempted to search for such an enhancement but obviously failed to find
it. Patching the changeset in was fairly straightforward.
Thanks very much Jonathan and Mike!!
On Wed, Aug 17, 2016 at 5:41 PM, Mike Bayer <mike...@zzzcomputing.com>
wrote:
>
>
> On 08/17/2016 01:25
Generally, echo=True for log level of INFO is very helpful for log files.
But on INSERT/UPDATE of a Binary column (at least with Oracle, BLOB) it
sure would be nice to skip the logging of the sometimes massive binary data.
Is this possible?
Thanks,
Kent
--
You received this message because
>
>
> On 05/28/2016 09:44 AM, Kent wrote:
>
>> I'm interested in being able to use second time intervals on PostgreSQL,
>> Oracle 8 /and /modern Oracle versions, agnostically.
>>
>> The native python timedelta works great for the postgres and cx_Oracle
&g
elta as bind param
from datetime import timedelta
td = timedelta(seconds=element.seconds)
*return ...???*
Can anyone help me with the else: above to use the native python timedelta
as a bind param? (Or trash it completely if there is a better strategy?)
Much thanks in advanc
Yeah, it seems to me that if you pass a *specific connection* to a
sessionmaker for some (whatever) reason, that sessionmaker shouldn't ever
silently take a different one.
I'll need to work on detecting or sabotaging new connections from a
sessionmaker which was passed a specific connection. (I
ah either don't
> call that , or set up the connection immediately on the next session.
>
> On Wednesday, April 13, 2016, Kent Bower <k...@bowermail.net
> <javascript:_e(%7B%7D,'cvml','k...@bowermail.net');>> wrote:
>
>> About a year ago you helped me ensure my
was called. Is there a way to guarantee this?
See attached script that fails on version 1.0.12
Is this the intended behavior when sessionmaker has a specific connection
as bind?
On Mon, Mar 23, 2015 at 12:40 PM, Michael Bayer <mike...@zzzcomputing.com>
wrote:
>
>
> Kent <
Thanks very much Mike.
On Monday, March 23, 2015 at 12:40:46 PM UTC-4, Michael Bayer wrote:
Kent jkent...@gmail.com javascript: wrote:
In cases where we interact with the database session (a particular
Connection) to, for example, obtain an application lock which is checked
out from
In cases where we interact with the database session (a particular
Connection) to, for example, obtain an application lock which is checked
out from database for the lifetime of the database session (not just the
duration of a transaction), it is important that I guarantee future scoped
) before issuing the
DBMS_SESSION.SET_CONTEXT(...). But, once I know that within
before_cursor_execute, can I (recursively) issue an conn.execute() for that
statement safely or will it affect the original execute?
On Saturday, March 7, 2015 at 6:38:08 PM UTC-5, Michael Bayer wrote:
Kent jkent
Perfect, thanks much!
On Saturday, March 7, 2015 at 6:38:08 PM UTC-5, Michael Bayer wrote:
Kent jkent...@gmail.com javascript: wrote:
I'm implementing database session variables (in Oracle,
DBMS_SESSION.SET_CONTEXT(...)), in order to be able to set (from
sqlalchemy) and retrieve (from
to record the fact that I've
set the database session's variables on an object (such as
connection_record) so that subsequent requests can detect whether it needs
to be reset. Will connection_record correspond to a database session?
Thanks in advance for any advice here.
Kent
--
You
WHERE anon_1.productid*(+)* = products.productid ORDER BY anon_1.siteid
Interestingly, use-ansi=True correctly renders LEFT OUTER JOIN in 0.8.7
but it fails to render as an outer join with use-ansi=False.
Thanks for you time and exceptional software,
Kent
--
You received this message because
for security issues
back to 0.8. there’s a new website section coming soon that will show this
stuff.
Kent jkent...@gmail.com javascript: wrote:
Here it is:
commit 85368d25ed158c85bd19f4a63400884ab1cda26a
Author: Mike Bayer m...
Date: Sat Jun 8 18:54:14 2013 -0400
, January 21, 2015 at 1:13:21 PM UTC-5, Michael Bayer wrote:
Kent jkent...@gmail.com javascript: wrote:
Mike,
When using use_ansi=False for Oracle (8) in conjunction with
joinedload-ing an inline view property, SQLAlchemy-0.8.7 renders an inner
join instead of an outer join. This has
Hmmm 0.7 is missing expression.FromGrouping... I imagine that is a big
deal, isn't it, like not really patchable?
On Wednesday, January 21, 2015 at 3:11:29 PM UTC-5, Kent wrote:
Here it is:
commit 85368d25ed158c85bd19f4a63400884ab1cda26a
Author: Mike Bayer m...
Date: Sat Jun 8 18
, 2013, at 6:06 PM, Kent jkentbo...@gmail.com wrote:
Thank you, I'll try that, but quick concern: I specifically skipped trying to use
.subquery() because the docs say Eager JOIN generation within the query is
disabled.
Doesn't that mean I won't get my joinedload() results from the inner query
with the EmailAddress table to strictly filter results.
Employee records:
idname
1 kent
2 charlie
EmailAddress records:
empid address
===
1k...@mymail.goo
1k...@mymail.goo
1k...@gmail.de
2char...@gmail.de
statement here so sqlalchemy won't translate result rows
into object instances.
Can you point me in the right direction for one of these 2 solutions,
please?
Many thanks,
Kent
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from
eager join disabled?
On 5/30/2013 5:54 PM, Michael Bayer wrote:
On May 30, 2013, at 5:19 PM, Kent jkentbo...@gmail.com
mailto:jkentbo...@gmail.com wrote:
Solution A:
Group by all columns (yielding the same effect as distinct), but
which makes the window analytical function
I notice that Hybrid Attributes don't show up as mapper properties (since
they are class wide instead of mapper specific, I suppose). I couldn't
find documentation on whether I can undefer these? Or can I create a
synonym or column_property from a hybrid attribute in the mapper?
--
You
I suppose what I'm really after is a column_property (for class level) and
plain descriptor (for instance level), which is exactly what Hybrid
attributes are meant to be, but I wanted them to be part of the mapper and
undeferred in some cases.
On Thursday, March 7, 2013 11:36:37 AM UTC-5, Kent
That makes sense,
Thanks,
Kent
On Mar 7, 2013, at 12:09 PM, Michael Bayer mike...@zzzcomputing.com wrote:
The hybrid attribute is a Python function that invokes when it's called. So
it doesn't make sense for it to be a column property since there is no
attribute to be populated
By design, when a query() fetches an existing object, it doesn't refresh
the values unless populate_existing() is included with the query. The
documentation for populate_existing() states it isn't meant for general
purpose.
Occasionally, however, objects need to be selected FOR UPDATE,
I imagine this gets ugly when autoflush is disabled... perhaps that is why
it requires populate_existing()?
On Tuesday, March 5, 2013 10:00:36 AM UTC-5, Kent wrote:
By design, when a query() fetches an existing object, it doesn't refresh
the values unless populate_existing() is included
is certainly something doable
(because I would hope very much that anyone using this method has read
the documentation carefully).
On Mar 5, 2013, at 10:00 AM, Kent jkentbo...@gmail.com
mailto:jkentbo...@gmail.com wrote:
By design, when a query() fetches an existing object, it doesn't
refresh
We often use this pattern:
try:
session.query().one()
except orm_exc.NoResultFound:
gracefully deal with it
If the query() execution causes an autoflush, I just want to make sure that
an autoflush will never raise orm_exc.NoResultFound, or we could be
catching the wrong error. Were that
to evolve quickly, I'm using trunk.
Thanks,
Kent
--
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
sqlalchemy+unsubscr...@googlegroups.com
Thank you for the clarifications.
On 10/18/2012 11:43 AM, Michael Bayer wrote:
On Oct 17, 2012, at 9:55 PM, Kent wrote:
The attached script fails with sqlalchemy.exc.InvalidRequestError: Instance 'Bug at
0x1e6f3d10' has been deleted. Use the make_transient() function to send this object
On Thursday, October 18, 2012 11:43:50 AM UTC-4, Michael Bayer wrote:
On Oct 17, 2012, at 9:55 PM, Kent wrote:
The attached script fails with sqlalchemy.exc.InvalidRequestError:
Instance 'Bug at 0x1e6f3d10' has been deleted. Use the make_transient()
function to send this object back
this scenario since in a rare case, it presents.
Thanks very much!
Kent
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/6oYSFMbpnEsJ.
To post to this group, send
It sounds like you are trying to do at least 6 quite complicated
things all at once, without really understanding any of them. This
will not be easy.
Sigh. The story of my life in one sentence.
On Tue, Oct 2, 2012 at 8:43 AM, Simon King si...@simonking.org.uk wrote:
On Mon, Oct 1, 2012 at 11:38
You've mentioned multiple times (to me and others) that some operations,
such as reaching across relationships or loading relationships from within
a before_update Mapper event is not safe.
- I understand this is safe from within Session event before_flush(),
correct?
- We mentioned
for the
session.query().get(), but I there are 11 queries instead, most of them
redundant.
Any ideas?
Thanks,
Kent
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/vC69eQMhv10J
Thank you!
On 6/5/2012 4:41 PM, Michael Bayer wrote:
On Jun 5, 2012, at 4:21 PM, Kent wrote:
I am subquery loading some related properties for a polymorphic
inheritance use case similar to the script attached. SQLA seems to
be issuing several extra queries that I didn't expect and don't
Suppose I am using single table polymorphic inheritance like the docs
Employee/Manager/Engineer example. I have a relationship that I want to
have a different cascade or loading strategy for, depending on the mapper.
Can I inherit from the base mapper and override the property, like this:
, 2012, at 6:05 PM, Kent wrote:
Couldn't find answer in docs, does sqlalchemy support:
INSERT INTO ... (SELECT .. )
instead of
INSERT INTO ... VALUES...
--
You received this message because you are subscribed to the Google
Groups sqlalchemy group.
To view this discussion on the web visit
https
')) or
something like that. Maybe people have suggestions.
On Mar 30, 2012, at 6:43 PM, Kent Bower wrote:
Thanks for pointing me there. As an aside, the recipe would be more
bulletproof if it specified the columns (order). Currently, it
assumes sqlalchemy knows the order of the columns in the database
Hoping for advice: I'm using sqlalchemy against a legacy application's
database design, most of which isn't in my control. I have a situation
where single table inheritance should work beautifully but there is one
catch: of the 7 polymorphic sub classes, there is one which is allowed to
That will work for me, thanks!
P.S. make a note that the doc statement that it will be a future release
should be updated.
On 3/21/2012 10:04 AM, Michael Bayer wrote:
also polymorphic_on can be any SQL expression in 0.7, like a CASE statement if
you wanted.
--
You received this message
I suspect this doesn't interest you so much, and no offense taken if not,
but have you ever considered supporting the idea of a half
merge/save-update cascade for many to many relationships?
The use case is where I want to merge/save-update to the secondary table
only (collection status), but
iPhone
On Feb 29, 2012, at 8:55 AM, Kent jkentbo...@gmail.com
mailto:jkentbo...@gmail.com wrote:
I suspect this doesn't interest you so much, and no offense taken if
not, but have you ever considered supporting the idea of a half
merge/save-update cascade for many to many relationships?
The use
Is there a simple way to revert all columns back to their committed
state (some columns may be synonyms), or do I need to loop through
mapper.iterate_properties, get the ColumnProperty ones, make sure they
aren't aliases (prop.columns[0] is Column) and use setattr() to set
the value back to the
On Feb 28, 5:39 pm, Michael Bayer mike...@zzzcomputing.com wrote:
oh also you might want to use attributes.set_committed_state instead of
setattr() so that the history is cleared.
1) What do you mean? setattr() also clears the history if you set it
back to what it used to be... right?
2)
On Feb 1, 3:17 pm, Kent jkentbo...@gmail.com wrote:
If the value is based on what's already been INSERTed for previous rows,
I'd emit a SQL statement to get at the value.If it's based on some kind
of natural consideration that isn't dependent on the outcome of an INSERT
statement
If the value is based on what's already been INSERTed for previous rows, I'd
emit a SQL statement to get at the value.If it's based on some kind of
natural consideration that isn't dependent on the outcome of an INSERT
statement, then you can do the looping above within the
as previously and if that was considered a bug, etc.
Thanks,
Kent
--
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
sqlalchemy+unsubscr
your input and thoughts.
Thanks,
Kent
--
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
sqlalchemy+unsubscr...@googlegroups.com.
For more
, which is very good to understand more clearly.
Thanks.
On 1/26/2012 12:06 PM, Michael Bayer wrote:
On Jan 26, 2012, at 11:28 AM, Kent Bower wrote:
I think I understand why, during a flush(), if I use session.query().get() for
an item that was just added during this flush, I don't get
, meaning it would look a lot like
before_update. But looping through .new, .dirty, and .deleted is how to do it
for now.
On Jan 26, 2012, at 12:12 PM, Kent wrote:
Fair enough. I had enough understanding of what must be going on to know flush
isn't straightforward, but I'm still glad I asked
Is there a straightforward way to determine if a RelationshipProperty
has a corresponding reverse (backref)?
--
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
I assume the non public property._reverse_property is just what I'm
looking for. :)
On Jan 26, 2:06 pm, Kent jkentbo...@gmail.com wrote:
Is there a straightforward way to determine if a RelationshipProperty
has a corresponding reverse (backref)?
--
You received this message because you
At some point you changed the InstrumentedAttribute.get() method from
try:
return dict_[self.key]
except KeyError:
...
To this:
432 - def get(self, state, dict_, passive=PASSIVE_OFF):
433 Retrieve a value from the given object.
434
435 If a callable is
What is the easiest way to confirm that my installation has compiled/
is using the c extensions?
--
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
Yeah, just the two cresultproxy.so and cprocessors.so, right?
On 1/12/2012 3:34 PM, Michael Bayer wrote:
when you do the setup.py the log messages say so.
Otherwise you'd look where sqlalchemy was installed and check if you see .so
files.
On Jan 12, 2012, at 12:35 PM, Kent wrote:
What
funny story, here's where it was added:
http://www.sqlalchemy.org/trac/ticket/1910 which is essentially your ticket !
:)
I just double checked and I had patched in rfde41d0e9f70
http://www.sqlalchemy.org/trac/changeset/fde41d0e9f70/. Is there
another commit that went against 1910? For
See http://www.sqlalchemy.org/trac/ticket/2372
--
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
sqlalchemy+unsubscr...@googlegroups.com.
Mike,
Old code:
==
def visit_bindparam(bindparam):
if bindparam.key in bind_to_col:
bindparam.value = lambda:
mapper._get_state_attr_by_column(
state, dict_,
Thank you very much!
On 1/10/2012 11:47 AM, Michael Bayer wrote:
Code wasn't covered and is a regresssion, fixed in rd6e321dc120d.
On Jan 10, 2012, at 10:58 AM, Kent wrote:
Mike,
Old code:
==
def visit_bindparam(bindparam
After 0.7.5 migration, I'm sometimes hitting an issue from within
merge().
unitofwork.py
def track_cascade_events(descriptor, prop):
...
def set_(state, newvalue, oldvalue, initiator):
# process save_update cascade rules for when an instance
# is attached to another instance
i guess the patch is interacting with that load_on_pending stuff, which I
probably added for you also. It would be nice to really work up a new
SQLAlchemy feature: detached/transientobject loading document that really
describes what it is we're trying to do here.If you were to write
On 1/9/2012 2:33 PM, Michael Bayer wrote:
On Jan 9, 2012, at 2:30 PM, Kent wrote:
i guess the patch is interacting with that load_on_pending stuff, which I probably
added for you also. It would be nice to really work up a new SQLAlchemy feature:
detached/transientobject loading document
On 1/9/2012 5:33 PM, Michael Bayer wrote:
On Jan 9, 2012, at 2:36 PM, Kent Bower wrote:
that means some of the columns being linked to the foreign keys on the target are None.
If you want your lazyload to work all the attributes need to be populated. If you're
hitting the get committed
The statements that are executed as a single statement make no such
check (and the database engine correctly translates a string to
integer), but cursor.executemany checks type:
lib/sqlalchemy/engine/default.py, line 327, in do_executemany
cursor.executemany(statement, parameters)
TypeError:
Oh. Makes sense. Then the only reason I'm starting to hit this is
that you've optimized the orm to use executemany() more often,
correct?
On Jan 3, 3:09 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Jan 3, 2012, at 1:58 PM, Kent wrote:
The statements that are executed as a single
On 12/27/2011 5:34 PM, Michael Bayer wrote:
On Dec 27, 2011, at 5:21 PM, Kent wrote:
So see what happens if you, for the moment, just monkeypatch over
orm.session._state_session to do a lookup in a global context if
state.session_id isn't set. If that solves the problem of I want
detached
Was it your intention to no longer allow this type of query().get()?
session.query(cls.orderid).get(orderid)
I get InvalidRequestError: get() can only be used against a single
mapped class. but the wording is such that I'm not sure you intended to
limit that use case (there is only a single
On Dec 28, 12:07 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Dec 28, 2011, at 11:34 AM, Kent wrote:
Was it your intention to no longer allow this type of query().get()?
session.query(cls.orderid).get(orderid)
it was ! yes.
I get InvalidRequestError: get() can only
in fact, I modified our Query class after .first() was being abused
out of laziness:
def first(self):
raise ProgrammingError(Never use .first(); please use .get()
or .one()\n
.one() makes sure there is only one return and .get()
returns None if doesn't exist.\n
On Dec 26, 5:12 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Dec 26, 2011, at 1:50 PM, Kent wrote:
Yes, a nice simplification.
I'm using it to lazyload attributes for objects that aren't in a
session. I'm not sure if you pointed me there, I think I found it
myself, but you
In http://www.sqlalchemy.org/trac/changeset/7025%3A0a6576abea5b#file1
you added a warning that I'm hitting now.
'when save-update cascade is disabled, or the target object is
otherwise not
present in the session, and collection/scalar changes have taken
place. A warning
is emitted describing the
On 12/27/2011 2:34 PM, Michael Bayer wrote:
On Dec 27, 2011, at 1:51 PM, Kent wrote:
In http://www.sqlalchemy.org/trac/changeset/7025%3A0a6576abea5b#file1
you added a warning that I'm hitting now.
'when save-update cascade is disabled, or the target object is
otherwise not
present
So see what happens if you, for the moment, just monkeypatch over
orm.session._state_session to do a lookup in a global context if
state.session_id isn't set. If that solves the problem of I want detached
objects to load stuff, for you and everyone else who wants this feature,
then
summarize how this is meant to work now? (I think the
doc string is wrong now??)
On 12/25/2011 10:31 AM, Michael Bayer wrote:
yes a few change names, reconstruct_instance, init_instance, init_failed.
On Dec 24, 2011, at 7:42 PM, Kent Bower wrote:
Right. And reconstruct_instance
1 - 100 of 331 matches
Mail list logo