[sqlalchemy] Changing the order_by with Result-Set mapping

2007-04-03 Thread Paul Kippes
I'm finally getting a bit more at ease with the more complex aspects of SQLAlchemy. But yet again, I still need some help. Now I'm trying to change the ordering from my mapper's default. My Signal mapper was defined to order by the signal_name (using an AssociationProxy). That has been

[sqlalchemy] remove duplicates - DISTINCT constraint

2007-04-03 Thread Disrupt07
I need to populate a table with author names for example the table name is author and it has a field authorname of type text. authorname has the following values: W. Shakespear J. Smith W. Shakespear R. Williams K. Winslet ... and so on. Then I want SQLAlchemy to remove the duplicates, so that

[sqlalchemy] Re: remove duplicates - DISTINCT constraint

2007-04-03 Thread Glauco
Disrupt07 ha scritto: I need to populate a table with author names for example the table name is author and it has a field authorname of type text. authorname has the following values: W. Shakespear J. Smith W. Shakespear R. Williams K. Winslet ... and so on. Then I want SQLAlchemy to

[sqlalchemy] Re: remove duplicates - DISTINCT constraint

2007-04-03 Thread Glauco
Disrupt07 ha scritto: Thanks. But what do you mean by a type 'set' ? Is this a functionality of SQLAlchemy or of a list or some programming language? What's your data sources ? a python list? a text file? another DB? You can do a sequence of insert into with a unique contraint over

[sqlalchemy] parameter binding in connection.execute()

2007-04-03 Thread Marco Mariani
I know I can have bound parameters in engine.text(): t = engine.text(select foo from mytable where lala=:hoho) r = t.execute(hoho=7) ...but I need the same for connection.execute(), since I am using temporary tables and they are not accessible via engine.text Should I resort to manual

[sqlalchemy] Re: multiple table inheritance problem

2007-04-03 Thread svilen
Julien Cigar wrote: Another quick question, relative to multiple inheritance. Is it common to keep a back reference to the parent class within the child class ? u mean theclass.__bases__? or what? The idea behind this is that I want to be able to retrieve the child from the parent.

[sqlalchemy] Re: Concurrency problem

2007-04-03 Thread Michael Bayer
On Apr 2, 2007, at 10:35 PM, Barry Warsaw wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Our populate_instance() checks the isnew flag and if this is true, it does not call our initialization stuff. Now, I don't really see the isnew flag documented, so I assumed it was only called

[sqlalchemy] Re: new features in 0.3.6

2007-04-03 Thread Michael Bayer
On Apr 3, 2007, at 5:58 AM, Glauco wrote: In [1]: t = TipoFigura() In [1]: t.mapper.mapped_table Table('tipo_figura',DynamicMetaData(), Column('codice',PGChar(length=1),primary_key=True,nullable=False), Column('descrizione',PGText (length=None),nullable=False),schema=None)

[sqlalchemy] Re: new features in 0.3.6

2007-04-03 Thread Glauco
Michael Bayer ha scritto: On Apr 3, 2007, at 5:58 AM, Glauco wrote: In [1]: t = TipoFigura() In [1]: t.mapper.mapped_table Table('tipo_figura',DynamicMetaData(), Column('codice',PGChar(length=1),primary_key=True,nullable=False), Column('descrizione',PGText

[sqlalchemy] Re: new features in 0.3.6

2007-04-03 Thread Michael Bayer
On Apr 3, 2007, at 11:26 AM, Glauco wrote: Yes, but i lost generative methods filter_by First of all, filter_by() has no interaction with instances(). with instances(), no SQL is constructed by the Query object - it takes the result set of whatever exact select() statement youve

[sqlalchemy] Re: Database Disconnection Detection

2007-04-03 Thread Michael Bayer
check out the very latest trunk and apply this patch: Index: lib/sqlalchemy/databases/oracle.py === --- lib/sqlalchemy/databases/oracle.py (revision 2487) +++ lib/sqlalchemy/databases/oracle.py (working copy) @@ -409,6 +409,8 @@

[sqlalchemy] Re: simple many-to-many select

2007-04-03 Thread Michael Bayer
On Apr 3, 12:39 pm, Alexandre CONRAD [EMAIL PROTECTED] wrote: And I'd like to find all attachments from one client. But as there's a weak (secondary) table in between, I can no longer have something like: model.Attachment.id_client==c.client.id How can I achieve this ? using a

[sqlalchemy] Re: Concurrency problem

2007-04-03 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Apr 3, 2007, at 9:35 AM, Michael Bayer wrote: OK, yes, im sorry about the lack of docs for isnew...sometimes i subconsciously want to see how long it takes for someone to ask me about something (bad habit) although in this case that flag is