[sqlalchemy] Re: Problem with SQL views

2006-10-17 Thread Michael Bayer
On Oct 17, 2006, at 3:26 AM, artee wrote: of postgres views. Views are one of most important thing in DB programming. I'm surprised that this topic isn't tested in SA :( heh...i meant just the reflection of views. if you create a view in oracle and try to reflect it like a table, youll

[sqlalchemy] ForeignKeyConstraint or ForeignKey ?

2006-10-17 Thread Alexandre CONRAD
Hello, What's the difference between using object ForeignKeyConstraint or using object Column with a ForeignKey object as argument ? From this question follows this other one: what's the difference between using onupdate=CASCADE, ondelete=CASCADE from ForeignKeyConstraint and argument

[sqlalchemy] Re: How to add properties?

2006-10-17 Thread Christoph Zwerschke
Martin Kaffanke wr9te: This should normally be done, that all other properties are still there. Try to make an example script where you have problems, which we can run if you have troubles here. You're right. What confused me is that when you do mapper(User, pg_user, properties={

[sqlalchemy] retrieving and updating using mappers

2006-10-17 Thread warren . emmett
Hi, I am new to programming and have been experimenting with alchemy. I have been wanting to ask some really simple questions that I just cant seem to get right. I have been looking for sometime now to try find code examples but I get the feeling everyone is so far ahead of me it seems

[sqlalchemy] automatic datatype for a ForeignKey

2006-10-17 Thread Alexandre CONRAD
Hello, I was wondering why not having an automatic datatype assigned to a FK column instead of repeating twice the data type that has to be set... a user table would have: Column('user_id', Integer, primary_key=True), and an address table refereing to a user would have:

[sqlalchemy] Re: ObjectAlchemy - ODMG compatible layer for SQLAlchemy

2006-10-17 Thread Ilias Lazaridis
Michael Bayer wrote: On Oct 17, 2006, at 1:50 AM, Ilias Lazaridis wrote: I understand this like this: SQLAlchemy (DataMapper) can implement SQLObject (Active Record) SQLObject (Active Record) cannot implement SQLAlchemy (DataMapper) I recommend you read Fowler's book if youre

[sqlalchemy] Re: ObjectAlchemy - ODMG compatible layer for SQLAlchemy

2006-10-17 Thread Jonathan LaCour
Ilias Lazaridis wrote: I think it's clear that I'm neither looking for book-tips, nor for an academic discussion. I think what Michael is trying to convey is that the simple statement that you are looking for confirmation on has lots of highly academic baggage relating to what programmers

[sqlalchemy] Re: ObjectAlchemy - ODMG compatible layer for SQLAlchemy

2006-10-17 Thread Ilias Lazaridis
Jonathan LaCour wrote: Ilias Lazaridis wrote: [...] b) a simple confirmation of my conclusion: SQLAlchemy (DataMapper) can implement SQLObject (Active Record) SQLObject (Active Record) cannot implement SQLAlchemy (DataMapper) Your conclusion is misguided because you don't have any

[sqlalchemy] Stored procedures

2006-10-17 Thread George Sakkis
Is there a way to call a stored procedure from sqlalchemy and access the returned result set ? If it makes a difference, I'm specifically interested in MySQL stored procedures. What I want to do is use this result set as part of another query, but MySQL doesn't currently allow treating a stored

[sqlalchemy] Re: retrieving and updating using mappers

2006-10-17 Thread Christoph Zwerschke
[EMAIL PROTECTED] wrote: Firstly when retrieving information using mappers, I have not been very successful at all in this If someone could offer a 2 line example of this problem. Retrieving Email.address if User.name == 'jack' ... I have the same problem with locating a row and

[sqlalchemy] Re: ObjectAlchemy - ODMG compatible layer for SQLAlchemy

2006-10-17 Thread Nicola Larosa
Ilias Lazaridis wrote: Seems like Zope DB and Durus are the only dynamic solutions for python. The ORM league has (till now) failed to produce an dynamic OO layer on top of Relational databases. Ok guys, drop the keyboards, don't feed the troll:

[sqlalchemy] Re: Stored procedures

2006-10-17 Thread George Sakkis
Michael Bayer wrote: the func keyword is used for stored procedures. in the latest trunk, you can also create table-like elements out of funcs to support multi-column stored procedures, and you can create the SQL corresponding to the patterns you describe. That's pretty cool, too bad I

[sqlalchemy] Re: ObjectAlchemy - ODMG compatible layer for SQLAlchemy

2006-10-17 Thread Jonathan LaCour
Ilias Lazaridis wrote: peoples words: SQLAlchemy implements the Data Mapper pattern, of which the Active Record pattern (which SQLObject implements) is a subset. please notice: subset. My conclusion is of course correct, and is based on the meaning of the term subset. The direct quote

[sqlalchemy] order_by strangeness

2006-10-17 Thread GeoffL
Hi, I'm using SQLAlchemy 0.28 with Pylons 0.98, and when I define this structure (abridged, so I'm not sure it will really compile...) people_table = Table(people, metadata, Column('id', Integer, primary_key=True), Column('user_name', String), Column('first_name', String),

[sqlalchemy] session.flush() closing connection

2006-10-17 Thread fw
Hi, I am using version 0.2.8 with Python 2.4.3 and MySQL 4.1.21 on an up-to-date Linux Gentoo box I am having a problem with session.flush(). It seems that every time I issue a session flush the DB connection is closed. If I do something like this eng = create_engine('mysql://test:[EMAIL