Re: [sqlalchemy] distinct on

2013-05-24 Thread Jose Soares
Thanks for reply, Mariano. j On 05/23/2013 12:37 PM, Mariano Mara wrote: On 05/23/2013 04:42 AM, jo wrote: |Hi all, I wondered if it is possible to execute a partial distinct in sqlalchemy. The following query works in oracle and postgresql: select distinct col1, first_value(col2) over

Re: [sqlalchemy] Creating an index if it doesn't exist

2013-05-24 Thread Michael Bayer
On May 23, 2013, at 8:06 PM, Mike Bissell biss...@amyris.com wrote: How might I convince SQLAlchemy 0.7.9 to create a newly added index on a table in the event that the index doesn't already exist? This new index is created as a member of __table_args__; it is not instantiated with

Re: [sqlalchemy] feel dirty, is there a better way?

2013-05-24 Thread Michael Bayer
I would apply a single event listener to Temporal, and do all the work of adding the constraints and all that in the one event handler. I'd skip __table_args__. If you're on 0.8, you can apply listeners to mixins and unmapped classes using propagate=True, and the events should trigger for all

[sqlalchemy] non foreign-key relationship between schemas

2013-05-24 Thread YKdvd
I'm working with a MySQL setup that has, say, a Studio database (or schema), and multiple Production schemas (Production_1, Production_2, etc). The Studio database has a seasons table, and the Production databases have episodes tables. Currently, the episodes table doesn't have a foreign key

Re: [sqlalchemy] non foreign-key relationship between schemas

2013-05-24 Thread Michael Bayer
On May 24, 2013, at 11:53 AM, YKdvd davidobe...@gmail.com wrote: class Production(Base): __table_args__ = {'schema':'Studio'} id = Column('id', Integer, primary_key=True, nullable=False) class Episode(Base): ... # some sort of relationship() back to Production, even

[sqlalchemy] Re: non foreign-key relationship between schemas

2013-05-24 Thread YKdvd
Yeah, I was afraid of that, but I thought there might be something going on with the relationship layer that might do the knitting. It would be a constant value (per schema/engine) I could have provided to the engine, metadata, mapper or whatever, but it isn't in the Episode row explicitly.

Re: [sqlalchemy] non foreign-key relationship between schemas

2013-05-24 Thread Michael Bayer
On May 24, 2013, at 12:34 PM, YKdvd davidobe...@gmail.com wrote: Yeah, I was afraid of that, but I thought there might be something going on with the relationship layer that might do the knitting. It would be a constant value (per schema/engine) I could have provided to the engine,

Re: [sqlalchemy] non foreign-key relationship between schemas

2013-05-24 Thread YKdvd
Yup, all episodes in a Production schema would belong to one specific production row. I guess I was thinking about the relationship more in terms of the automatic loading of the collection, and being able to add/delete from it and have it reflected on flush. It looks like @property

Re: [sqlalchemy] Can SQLAlchemy execute multiple select statements in a single round trip?

2013-05-24 Thread Charlie Clark
Am 23.05.2013, 21:50 Uhr, schrieb Sean Lynch techni...@gmail.com: Not within one of my SQLAlchemy apps, but I have an NHibernate application where the database and application servers are in different data centers (out of my control) and thus using .future() calls saves a good bit I/O time.

Re: [sqlalchemy] non foreign-key relationship between schemas

2013-05-24 Thread Charlie Clark
Am 24.05.2013, 17:53 Uhr, schrieb YKdvd davidobe...@gmail.com: but I can't seem to find anything that works. I can provide some sort of instance method or property with the necessary id value for foreign(), but I'm not sure if this is acceptable, or even if the remote reference is correct

[sqlalchemy] implementing implicit scalar collections

2013-05-24 Thread Burak Arslan
Hi, I've just implemented support for scalar collections for Spyne. (In Spyne terms that's sql serialization of an array of primitives). Seems to be working fine so far. The question is: Is the association proxy the only (read/write) way of doing this? It requires the child table to be

[sqlalchemy] What is polymorphic_on needed for in a joined table inheritance schema?

2013-05-24 Thread Alex Grönholm
I used joined table inheritance in Hibernate and it worked fine without any extra discriminator columns. Why is it necessary in SQLAlchemy? I can understand the need for such a column in single table inheritance, but not joined table. -- You received this message because you are subscribed to