[SQLObject] Many To Many with a existing middle table

2008-07-31 Thread Jerome Kerdreux
Hi, all. I'm trying to write a python library around the f-spot database. I used SQLO for a couple of projects so, I decided to use it here too. But f-spot database schema is not really standard so I need to use its intermediate table in a many to many. Here is the doc I used: http://www.

Re: [SQLObject] Many To Many with a existing middle table

2008-07-31 Thread Jerome Kerdreux
Oups ... > class Photo(SQLObject): > tags = RelatedJoin('Tag') > tags = SQLRelatedJoin('Tag',intermediateTable='photo_tags') Only the second declaration is the right one of course .. but the issue is still there. -- --

Re: [SQLObject] Many To Many with a existing middle table

2008-07-31 Thread Simon Cross
On Thu, Jul 31, 2008 at 2:10 PM, Jerome Kerdreux <[EMAIL PROTECTED]> wrote: > class PhotosTags(SQLObject): >class sqlmeta: >table = 'photo_tags' >photo = ForeignKey('Photo') >tag = ForeignKey('Tag') > Ok, but the right column in the intermediate table is this : > TABLE photo_ta

Re: [SQLObject] Many To Many with a existing middle table

2008-07-31 Thread Jerome Kerdreux
On Thu, 31 Jul 2008 15:16:05 +0200 "Simon Cross" <[EMAIL PROTECTED]> wrote: > On Thu, Jul 31, 2008 at 2:10 PM, Jerome Kerdreux <[EMAIL PROTECTED]> wrote: > > class PhotosTags(SQLObject): > >class sqlmeta: > >table = 'photo_tags' > >photo = ForeignKey('Photo') > >tag = ForeignKe

Re: [SQLObject] Many To Many with a existing middle table

2008-07-31 Thread Neil Muller
On Thu, Jul 31, 2008 at 2:10 PM, Jerome Kerdreux <[EMAIL PROTECTED]> wrote: > > > Hi, all. > > > And here is the result code. > > > class Photo(SQLObject): >class sqlmeta: >table = 'photos' >time = IntCol() >uri = UnicodeCol() >description = UnicodeCol() >roll_id = IntC

Re: [SQLObject] Many To Many with a existing middle table

2008-07-31 Thread Jerome Kerdreux
On Thu, 31 Jul 2008 17:07:04 +0200 "Neil Muller" <[EMAIL PROTECTED]> wrote: > On Thu, Jul 31, 2008 at 2:10 PM, Jerome Kerdreux <[EMAIL PROTECTED]> wrote: > > > > > > Hi, all. > > > > > > And here is the result code. > > > > > > class Photo(SQLObject): > >class sqlmeta: > >table = 'phot

[SQLObject] patch to add TIMESTAMP to DateTimeConverter

2008-07-31 Thread Matthew Wilson
I want to use the OVERLAPS keyword in postgres, but it complains because the current DateTimeConverter doesn't explicity set the type. This patch makes the change. This is my patch: It also corrects a tiny spelling error. Index: sqlobject/converters.py =

Re: [SQLObject] patch to add TIMESTAMP to DateTimeConverter

2008-07-31 Thread Oleg Broytmann
On Thu, Jul 31, 2008 at 08:58:04PM +, Matthew Wilson wrote: > Index: sqlobject/converters.py > === > --- sqlobject/converters.py (revision 3536) > +++ sqlobject/converters.py (working copy) > @@ -163,7 +163,7 @@ > register

Re: [SQLObject] patch to add TIMESTAMP to DateTimeConverter

2008-07-31 Thread Matthew Wilson
On Thu 31 Jul 2008 05:09:14 PM EDT, Oleg Broytmann wrote: > On Thu, Jul 31, 2008 at 08:58:04PM +, Matthew Wilson wrote: >> Index: sqlobject/converters.py >> === >> --- sqlobject/converters.py (revision 3536) >> +++ sqlobject/conve

Re: [SQLObject] patch to add TIMESTAMP to DateTimeConverter

2008-07-31 Thread Oleg Broytmann
On Thu, Jul 31, 2008 at 09:16:24PM +, Matthew Wilson wrote: > Is there some way to write a specific converterjust for postgresql, and > then allow other databases to use the original? Look into sqlobject/postgres/pgconnection.py; in the very end you find PsycoBinaryConverter; see how it's r