On Sunday 22 Jan 2012 12:57:33 AM Sana wrote:
• On page load im displaying data from the database each time the page
is refreshed the query hits the database to retrieve the data there by
taking long time for the page to load is thr any way by which the query hit
the table oly for new
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 the persistent object I might expect because the session
still has it as pending even though, logically, it is already persistent.
I don't suppose you have
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 the persistent
object I might expect because the session still has it as pending even
though,
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. Sorry for
having not read the documents very well and thanks for your answer,
because from it, I surmise that before_flush() *is* safe for session
operations,
yup, before_flush is made for that, and I've for some time had some vague plans
to add some more helpers there so you could get events local to certain kinds
of objects in certain kinds of states, meaning it would look a lot like
before_update. But looping through .new, .dirty, and .deleted
So, as a typical example of where it seems very natural to use
before_update, suppose you need to automatically update the not null
sequence of a related table. This but to get the sequence you need to
loop over the parent table's collection.
You want the sequence to be human friendly
On Jan 26, 2012, at 1:21 PM, Kent wrote:
So, as a typical example of where it seems very natural to use
before_update, suppose you need to automatically update the not null
sequence of a related table. This but to get the sequence you need to loop
over the parent table's collection.
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 are
Another possible approach is using the sql module to build the query:
from sqlalchemy import sql
ids = [1,2,3]
query = sql.select([Table.col1, Table.col2], Table.id.in_(ids))
session.execute(query)
I'm not sure how that fits into the larger context of what you're doing,
but it's flexible and
Hi,
I have some problem understanding this error. From googling around,
this is about modifying data on more than 1 table, so the ORM wouldn't
do it. However, my query is
self.session.query(e).filter(e.src_id == src_id).filter(e.tar_id ==
tar_id).update({e.status: self._DELETE})
and it only
On Jan 26, 2012, at 8:26 PM, Mason wrote:
Hi,
I have some problem understanding this error. From googling around,
this is about modifying data on more than 1 table, so the ORM wouldn't
do it. However, my query is
self.session.query(e).filter(e.src_id == src_id).filter(e.tar_id ==
12 matches
Mail list logo