Basically, I've got these simple classes mapped to tables, using
SQLAlchemy. I know they're missing a few items but those aren't
essential for highlighting the problem.
class Customer(object):
def __init__(self, uid, name, email):
self.uid = uid
self.name = name
Thanks for the input Michael. I think the polymorphism is messing
things up...just a hunch. Your suggestion didn't work but this ended
up working:
'children': relation(Category,
primaryjoin=and_(TABLES.CATEGORY.c.id==TABLES.CATEGORY.c.parent_id,
TABLES.BASE.c.deleted==False),
On May 26, 2010, at 4:56 PM, ObjectEvolution wrote:
> Hi,
>
> I've got the following tables in my app (only showing applicable
> columns here) storing categories for my app:
>
> Base
> - id (int) PK
> - deleted (int) - 0/1 as a value
>
> Category
> - id (int) PK/FK - refers to Base.id
> - pare
Hi,
I've got the following tables in my app (only showing applicable
columns here) storing categories for my app:
Base
- id (int) PK
- deleted (int) - 0/1 as a value
Category
- id (int) PK/FK - refers to Base.id
- parent_id (int) FK - self-referential to Category.id
I then have a Category objec
On May 26, 2010, at 1:39 PM, David Gardner wrote:
> I have a users table, with a lazy=False, innerjoin=True relation to the
> preferences table
> (these could probably be the same table but they are separate for historical
> reasons).
>
> One of the gotchas that I am running into is when I do
On May 26, 2010, at 1:33 PM, Dan Ellis wrote:
> On May 26, 9:43 am, Michael Bayer wrote:
>> You can expire the attribute manually ahead of time if you want it to reload
>> its value (should be fine within after_commit).
>
> No, it seems that in after_commit the newly added instance is not yet
I have a users table, with a lazy=False, innerjoin=True relation to the
preferences table
(these could probably be the same table but they are separate for
historical reasons).
One of the gotchas that I am running into is when I do an outerjoin on
to the user's table,
it effectively becomes a
On May 26, 9:43 am, Michael Bayer wrote:
> You can expire the attribute manually ahead of time if you want it to reload
> its value (should be fine within after_commit).
No, it seems that in after_commit the newly added instance is not yet
in session.identity_map, so session.expire throws an exc
Excerpts from Michael Bayer's message of Wed May 26 13:23:01 -0300 2010:
>
> On May 26, 2010, at 11:47 AM, Mariano Mara wrote:
>
> > Hi everyone. I have been working in a little class that brings support
> > for "with recursive" idiom in my project. Actually the part it supports
> > for the mome
On May 26, 9:43 am, Michael Bayer wrote:
> but if after_commit() is called and after_flush() is not called, that means
> nothing was flushed.
Right. So, for example, for a request that only does SELECTs, nothing
will be flushed, but after the request, I still do session.commit(),
because hasn
On May 26, 2010, at 11:47 AM, Mariano Mara wrote:
> Hi everyone. I have been working in a little class that brings support
> for "with recursive" idiom in my project. Actually the part it supports
> for the moment are the necessary bits to generate hierarchical data (I
> thought somebody might f
Hi everyone. I have been working in a little class that brings support
for "with recursive" idiom in my project. Actually the part it supports
for the moment are the necessary bits to generate hierarchical data (I
thought somebody might find it useful too so I added it as a recipe in
the wiki[1]).
Hi all,
Is there any harm in using scoped_session in a single threaded environment?
cheers,
Chris
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group,
search the docs for "tuple_".
On May 26, 2010, at 10:35 AM, Glauco Uri wrote:
> What is the best practice for this case?
>
> "select * from my_tbl where (a,b) in ((1,1),(2,2))"
>
>
> It seems to me that in clause is a column attribute so i don't figure how to
> sqlalchemyfy this where condi
On May 26, 2010, at 10:10 AM, dhanil anupurath wrote:
> Hi,
>
> Thanks for the quick reply.
> In my query i am not using any limit()/offset()/first()
> but i am using order by ascending. can "order by" cause an issue??
your stacktrace says you are using "first()":
Traceback (most recent call
What is the best practice for this case?
"select * from my_tbl where (a,b) in ((1,1),(2,2))"
It seems to me that in clause is a column attribute so i don't figure
how to sqlalchemyfy this where condition
Thank you in advance
Gla
--
Glauco Uri
Prometeia SpA
Via G. Marconi, 43 - 40122 Bolo
Hi,
Thanks for the quick reply.
In my query i am not using any limit()/offset()/first()
but i am using order by ascending. can "order by" cause an issue??
avail_states=DBSession.query(
AvailState).with_lockmode('update').\
filter(AvailState.entity_id.in_(input_entityids)).\
On May 26, 2010, at 9:16 AM, dhanil anupurath wrote:
> Hi
>
> I am using oracle/mysql and sqlalchemy for a project I am working on.
>
> I am using lockmode in SA query,while generating an ORACLE query it
> causes trouble.
>
> The class definition is like this:
>
> class AvailState(Base):
>
On May 26, 2010, at 12:18 AM, Dan Ellis wrote:
>
> class EventExtension(SessionExtension):
>def __init__(self):
>self.new = []
>
>def after_flush(self, session, flush_context):
>self.new = session.new
>return EXT_CONTINUE
>
>def after_commit(self, session):
I've only found partial answers to this problem so far, so I'd like to
expand on it here.
I have a site in which users post stories, and their friends are
notified. In order to decouple different parts of the business logic,
I would like to use a publish/subscribe mechanism that raises an event
fo
Hi
I am using oracle/mysql and sqlalchemy for a project I am working on.
I am using lockmode in SA query,while generating an ORACLE query it
causes trouble.
The class definition is like this:
class AvailState(Base):
MONITORING = 1
NOT_MONITORING = 0
__tablename__ = 'avail_current'
Hi
I am using oracle/mysql and sqlalchemy for a project I am working on.
I have a query executed like this
SELECT table_entity_id, table_entity_type, table_avail_state,
table_monit_state, table_transient_state, table_transient__1,
table_owner, table_timestamp, table_description FROM (SELECT
table
22 matches
Mail list logo