Re: [Sqlalchemy-users] PostGIS?

2006-09-21 Thread Wyatt Baldwin
On 9/21/06, dmiller <[EMAIL PROTECTED]> wrote: > > On Sep 21, 2006, at 2:16 AM, Wyatt Baldwin wrote: > > > I am attempting to use SQLAlchemy with PostGIS (spatial extensions for > > Postgres). I'm wondering if anyone out there has any experience with > > this. > > > > > > I was considering looking

Re: [Sqlalchemy-users] Is this the best way to do this or is there a better way?

2006-09-21 Thread jose
Thanks I hadn't tried that one, that makes the code look nicer Jose > Original Message > Subject: Re: [Sqlalchemy-users] Is this the best way to do this or is > there a better way? > From: Michael Bayer <[EMAIL PROTECTED]> > Date: Thu, September 21, 2006 1:46 pm > To: [EMAIL PRO

Re: [Sqlalchemy-users] Compound Keys: determining for create, using compound foreign keys

2006-09-21 Thread Michael Bayer
if the versions are truly just 1-N based, why even call to the database to get the number ?  if you set up a backreference on Version to get its Project, you can just do:class VersionKeyMapper(MapperExtension):    def before_insert(self, mapper, connection, instance):    instance.id = instance.proj

Re: [Sqlalchemy-users] Is this the best way to do this or is there a better way?

2006-09-21 Thread Michael Bayer
you can try off the class, as Tgmouse.c.pathnum On Sep 21, 2006, at 2:36 PM, [EMAIL PROTECTED] wrote: > Dear Sqlalchemy group, > > I'm pretty new to sqlalchemy and trying it out on a new project at > work. > I've been looking that the docs, and I've got a really simple > question. > I've se

Re: [Sqlalchemy-users] Compound Keys: determining for create, using compound foreign keys

2006-09-21 Thread Hogarty, David A.
Title: Re: [Sqlalchemy-users] How ACID are SQLAlchemy transactions? Looking at the code, the problem seems to arise in sqlalchemy/orm/mapper.py, in the save_obj function   The basic structure is:   run before_insert/before_update for all objects   save all the mapper attributes to a table

[Sqlalchemy-users] Is this the best way to do this or is there a better way?

2006-09-21 Thread jose
Dear Sqlalchemy group, I'm pretty new to sqlalchemy and trying it out on a new project at work. I've been looking that the docs, and I've got a really simple question. I've set up a session ( db = create_session() ) and now want to do a query with said session, but i want to do "like" type of qu

[Sqlalchemy-users] Compound Keys: determining for create, using compound foreign keys

2006-09-21 Thread Hogarty, David A.
Title: Re: [Sqlalchemy-users] How ACID are SQLAlchemy transactions? I'm having a little difficulty figuring out how to work with compound primary keys within the following context: I have Projects, Versions, and for examples sake, 'Things' inside of both of these, as follows:   CREATE TABL

Re: [Sqlalchemy-users] How ACID are SQLAlchemy transactions?

2006-09-21 Thread Michael Bayer
On Sep 21, 2006, at 10:51 AM, Wolfgang Keller wrote: > > I was wrong here. PostgreSQL notifications don't require polling > the database > server. It's just the libpq client library itself that requires > polling a > function to retrieve the notifications. > > But an example for Psycopg2 show

Re: [Sqlalchemy-users] Bug

2006-09-21 Thread Daniel Holth
Michael, Thanks. It was reflecting fine, it's just that nobody ever put the foreign key constraints into the DDL (what would MySQL do with them anyway). I solved my problem by just using relation(OtherTableObject, primaryjoin=ThisTableObject.c.id == OtherTableObject.c.id) When I use append_ite

Re: [Sqlalchemy-users] How ACID are SQLAlchemy transactions?

2006-09-21 Thread Michael Bayer
On Sep 21, 2006, at 10:51 AM, Wolfgang Keller wrote: >> mike wrote: >> if someone wants to write an extension, most easily to >> sessioncontext, that just synchronizes data between open sessions, >> thats not a big deal. But it really is somewhat of a reinvention of >> the database itself. the

Re: [Sqlalchemy-users] Bug

2006-09-21 Thread Michael Bayer
foreign keys should be reflected (if thats what youre asking). if you have a mysql table thats not reflecting properly, feel free to send its DDL on over. if you want a column to be a foreign key to several other tables, youre better off appending ForeignKeyConstraint objects to the end of

Re: [Sqlalchemy-users] How ACID are SQLAlchemy transactions?

2006-09-21 Thread Wolfgang Keller
>> For such cases, Modeling provides a mechanism that >> "broadcasts" changes made by one "editing context" to all others upon >> committing. Maybe they could share code with SQLAlchemy? > > if someone wants to write an extension, most easily to > sessioncontext, that just synchronizes data be

Re: [Sqlalchemy-users] PostGIS?

2006-09-21 Thread dmiller
On Sep 21, 2006, at 2:16 AM, Wyatt Baldwin wrote: > I am attempting to use SQLAlchemy with PostGIS (spatial extensions for > Postgres). I'm wondering if anyone out there has any experience with > this. > > > I was considering looking into the SQLAlchemy types and seeing if I > could hack together