[sqlalchemy] Re: ForeignKey + schema

2007-09-14 Thread Neil Blakey-Milner
On 9/13/07, Rick Morrison [EMAIL PROTECTED] wrote: SA 0.3* doesn't seem to handle relationships between tables in different schemas very well: it seems to think that schema.A - public.B is: schema.A - schema.B and even specifying primaryjoin= in the mapper won't help it.

[sqlalchemy] Profiling support

2007-09-14 Thread Hermann Himmelbauer
Hi, I'd like to know if there is some profiling support in SQLAlchemy. It would be nice if there would be some data accompanying SQL statements in the logfiles that can be used to optimize the RDB-part of the application (e.g. lazy/eager loading, specifying queries, creating indexes etc.).

[sqlalchemy] Automatically loading data into objects

2007-09-14 Thread Hermann Himmelbauer
Hi, In one of my database tables I have a varchar that is mapped to an object with a string attribute. This specific varchar should however be represented by a certain Python object, therefore it would be very handy, if there would be a way to automatically load/represent this data. Is there

[sqlalchemy] Re: Automatically loading data into objects

2007-09-14 Thread svilen
On Friday 14 September 2007 14:41:14 Hermann Himmelbauer wrote: Hi, In one of my database tables I have a varchar that is mapped to an object with a string attribute. This specific varchar should however be represented by a certain Python object, therefore it would be very handy, if there

[sqlalchemy] orphan'ed instance errors

2007-09-14 Thread Anil
class 'sqlalchemy.exceptions.FlushError': instance Location is an unsaved, pending instance and is an orphan (is not attached to any parent 'Host' instance via that classes' 'location' attribute, nor any parent 'User' instance via that classes' 'location' attribute) I have three tables: Host,

[sqlalchemy] Re: orphan'ed instance errors

2007-09-14 Thread Anil
BTW, here are my mappers: mapper(User, user_table, properties = { 'location': relation(Location, cascade=all, delete-orphan) }) mapper(Host, host_table, properties = {

[sqlalchemy] SQLAlchemy 0.4 beta5 (OperationalError) database table is locked '\nDROP TABLE os' () sqlite 3.4.2

2007-09-14 Thread jean-marc pouchoulon
helo, I don't understand why my sqlite database is locked on a drop ( the code is following) thanks for your explanation. 007-09-14 18:26:36,375 INFO sqlalchemy.engine.threadlocal.TLEngine.0x..f0 ROLLBACK Traceback (most recent call last): File

[sqlalchemy] Re: SQLAlchemy 0.4 beta5 (OperationalError) database table is locked '\nDROP TABLE os' () sqlite 3.4.2

2007-09-14 Thread jason kirtland
jean-marc pouchoulon wrote: helo, I don't understand why my sqlite database is locked on a drop ( the code is following) thanks for your explanation. [...snip...] ordinateurs = computers_table.select(computers_table.c.prix 100.0).execute() ordinateur_pas_cher =

[sqlalchemy] Re: orphan'ed instance errors

2007-09-14 Thread jason kirtland
Anil wrote: On Sep 14, 7:36 am, Anil [EMAIL PROTECTED] wrote: class 'sqlalchemy.exceptions.FlushError': instance Location is an unsaved, pending instance and is an orphan (is not attached to any parent 'Host' instance via that classes' 'location' attribute, nor any parent 'User' instance via

[sqlalchemy] Re: SQLAlchemy 0.4 beta5 (OperationalError) database table is locked '\nDROP TABLE os' () sqlite 3.4.2

2007-09-14 Thread jean-marc pouchoulon
j Here you're holding onto open cursors with 'something == ordinateurs.fetchone()'. Either explicitly close() the two result sets you're accessing with fetchone() or remove your reference to the rows and python gc will get around to closing the cursors at some point. ok thanks.

[sqlalchemy] Re: Load Lazy Relation in Separate Thread

2007-09-14 Thread John Lorance
Don't know how you are rendering this; but if this a web app, you could make an Ajax call which fires off the query, draw the grey bar, and have the callback from the Ajax query then render the results when they are ready.. On Sep 13, 2007, at 11:26 AM, Koen Bok wrote: Hi, I am doing

[sqlalchemy] Re: ForeignKey + schema

2007-09-14 Thread Rick Morrison
Im not sure about creation, but I've not had any problems using cross-schema foreign keys, relations, joins and so forth using SQLAlchemy 0.3 and PostgreSQL. ..and of course the test case I wrote up to show the problem worked fine. Turns out the issue was in the PK declaration for the table

[sqlalchemy] Re: Why is explicit 'and_' required for filter but not filter_by?

2007-09-14 Thread Rick Morrison
I think it might be more historical than anything else. Back when what is now filter() was a single argument to the select() call, on the SQL-API side, and there couldn't take any additional arguments, as the select() call was already pretty heavy with keyword arguments and it was easy to get

[sqlalchemy] Re: Profiling support

2007-09-14 Thread Rick Morrison
I believe the 0.4 unit tests have profiling support, have a look there. On 9/14/07, Hermann Himmelbauer [EMAIL PROTECTED] wrote: Hi, I'd like to know if there is some profiling support in SQLAlchemy. It would be nice if there would be some data accompanying SQL statements in the logfiles

[sqlalchemy] Re: Automatically loading data into objects

2007-09-14 Thread jason kirtland
Hermann Himmelbauer wrote: Hi, In one of my database tables I have a varchar that is mapped to an object with a string attribute. This specific varchar should however be represented by a certain Python object, therefore it would be very handy, if there would be a way to automatically

[sqlalchemy] Re: db autogenerated pks?

2007-09-14 Thread Smoke
On 12 Set, 19:31, Rick Morrison [EMAIL PROTECTED] wrote: SQL Server provides no facilities for retrieving a GUID key after an insert -- it's not a true autoincrementing key. The MSSQL driver for SA uses either @@IDENTITY or SCOPE_IDENTITY() to retreive the most-recently inserted