[sqlalchemy] Re: save/update and caching

2007-11-05 Thread klaus
On 2 Nov., 19:09, Michael Bayer [EMAIL PROTECTED] wrote: On Nov 2, 2007, at 1:15 PM, klaus wrote: Thanks, but this doesn't seem to do what I wanted. The merge modifies the object and therefore tries to update the underlying table on session.flush(). So it might work if you prevented

[sqlalchemy] MetaData reflect on Oracle with multiple visible tables

2007-11-05 Thread Michael Schlenker
Hi all, i try to introspect a schema for an Oracle database on a site with multiple users, which have nearly identical schemas (common scenario on a development host). E.g. in the database there are: msc_ora1.sct0001_00 msc_ora2.sct0001_00 create by the two users msc_ora1 and msc_ora2. Now

[sqlalchemy] Re: MetaData reflect on Oracle with multiple visible tables

2007-11-05 Thread Michael Bayer
On Nov 5, 2007, at 6:44 AM, Michael Schlenker wrote: I tried with: meta.reflect(schema=msc_ora1) but it raises the same exception. I have noticed the 'owner' attribute on the Table class, but how can i specify an owner for reflection as requested by the Exception? you'd have to

[sqlalchemy] Re: MetaData reflect on Oracle with multiple visible tables

2007-11-05 Thread Michael Schlenker
Michael Bayer schrieb: On Nov 5, 2007, at 6:44 AM, Michael Schlenker wrote: I tried with: meta.reflect(schema=msc_ora1) but it raises the same exception. I have noticed the 'owner' attribute on the Table class, but how can i specify an owner for reflection as requested by the

[sqlalchemy] Re: MetaData reflect on Oracle with multiple visible tables

2007-11-05 Thread Michael Bayer
ah, excellent - patch looks pretty good, thanks. On Nov 5, 2007, at 8:59 AM, Michael Schlenker wrote: Michael Bayer schrieb: On Nov 5, 2007, at 6:44 AM, Michael Schlenker wrote: I tried with: meta.reflect(schema=msc_ora1) but it raises the same exception. I have noticed the 'owner'

[sqlalchemy] introspecting backreferences

2007-11-05 Thread Kapil Thangavelu
i've got two mapped classes in a many 2 many relationship. i declare the relationship on one class mapper with a backreference attribute specified. i'm interested to know if i can find this backreference property from the other class in the relationship which doesn't have the mapper property

[sqlalchemy] Re: introspecting backreferences

2007-11-05 Thread Michael Bayer
all MapperProperty objects associated with a Mapper are expressed through its get_property() and iterate_properties() accessors. as this is the FAQ-of-the-week im going to remove properties from Mapper and throw in a raise, stating this information. On Nov 5, 2007, at 10:48 AM, Kapil

[sqlalchemy] Re: unicode support for MSSQL

2007-11-05 Thread Paul Johnston
Hi, I have 10 different instances the each have their own collation names (latin1, greek, russian...) I have a master database that references all thos instances + their collation names. I use this master database to create the engines to the different dbs. I would like to be able to just pass

[sqlalchemy] access mapped object attributes

2007-11-05 Thread Eric Lemoine
Hello Have a question related to mapped objects and reflecting tables. If have this simple configuration: messages = Table('messages', meta, autoload=True) class Message(object): pass mapper(Message, messages) Given a Message object, do I have a way to retrieve all the attributes that

[sqlalchemy] Re: access mapped object attributes

2007-11-05 Thread Paul Johnston
Hi, Given a Message object, do I have a way to retrieve all the attributes that result from the database mapping? Try this: for col in Message.c: ... Paul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] column and table functions from sqlalchemy.sql

2007-11-05 Thread Christoph Zwerschke
Just noticed that from sqlalchemy import * imports all functions from sqlalchemy.sql.expression, except column and table - is this by intent or have these only be forgotten? -- Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[sqlalchemy] Re: Add arbitrary information to some classes

2007-11-05 Thread Paul Johnston
Hi, sorry, i havent been following. two++ dicts ?! this is getting out of hand. if we have to have any dicts at all, it would be just one dict. and also, it should be proxied through a property so that if you dont access it, its never even created. I have just put a proposed

[sqlalchemy] Re: column and table functions from sqlalchemy.sql

2007-11-05 Thread Paul Johnston
Hi, Just noticed that from sqlalchemy import * imports all functions from sqlalchemy.sql.expression, except column and table - is this by intent or have these only be forgotten? It's to prevent confusion between column and Column - which are very different! Paul

[sqlalchemy] Re: Add arbitrary information to some classes

2007-11-05 Thread jason kirtland
Paul Johnston wrote: I have just put a proposed patch on ticket #573. It uses info as the name and puts it on SchemaItem. Due to the way constructors are arranged for SchemaItem subclasses, I've explicitly put this in the constructor for Table and Column. Happy to take further comments

[sqlalchemy] Getting the names of text columns

2007-11-05 Thread Mike Orr
What's the simplest way to get the names of all columns containing character data (VARCHAR or TEXT). I've got it down to this, which works but is a bit obscure: def get_text_fields(table): substrings = [text, string, char] ret = [] for c in table.columns: name =

[sqlalchemy] Re: Getting the names of text columns

2007-11-05 Thread Michael Bayer
On Nov 5, 2007, at 4:11 PM, Mike Orr wrote: What's the simplest way to get the names of all columns containing character data (VARCHAR or TEXT). I've got it down to this, which works but is a bit obscure: def get_text_fields(table): substrings = [text, string, char] ret = []

[sqlalchemy] Re: access mapped object attributes

2007-11-05 Thread Eric Lemoine
On 11/5/07, Paul Johnston [EMAIL PROTECTED] wrote: Hi, Given a Message object, do I have a way to retrieve all the attributes that result from the database mapping? Try this: for col in Message.c: It works. thanks a lot Paul, -- Eric

[sqlalchemy] Multiple mapper extensions broken in 0.4

2007-11-05 Thread Rick Morrison
Seems that when multiple mapper extensions are used, only the first is run. Testcase attached --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] Re: Multiple mapper extensions broken in 0.4

2007-11-05 Thread Michael Bayer
you need to return EXT_CONTINUE for your TimestampExtension methods. On Nov 5, 2007, at 4:45 PM, Rick Morrison wrote: from sqlalchemy import * from sqlalchemy.orm import * import datetime import time class TimestampExtension(MapperExtension): def _decorate_instance(self, instance):

[sqlalchemy] Re: Multiple mapper extensions broken in 0.4

2007-11-05 Thread Rick Morrison
Ah. OK, thanks! I checked in a small update to the 3.x - 4.0 migration guide in the docs to note this. On 11/5/07, Michael Bayer [EMAIL PROTECTED] wrote: you need to return EXT_CONTINUE for your TimestampExtension methods. Rick --~--~-~--~~~---~--~~ You