From rcampbell at pcwi.net Wed Feb 1 20:20:57 2006 From: rcampbell at pcwi.net (Rob Campbell) Date: Wed, 01 Feb 2006 11:20:57 -0800 Subject: [Z3-sqlos] SQL error in sqlos_sample In-Reply-To: <43DFA58E.1080501@pcwi.net> References: <43DFA58E.1080501@pcwi.net> Message-ID: <43E10A19.4020107@pcwi.net> I answered my own question. The sequence was not created by the included postgres.sql script. So I had to add the sequence manually with CREATE SEQUENCE person_id_seq. Rob Campbell Pacific Coast Wireless Internet Rob Campbell wrote: > Hello, > > I was just trying out sqlos with Zope 3.2.0 and PostgreSQL 8.0.3. I was > able to add it to Zope, but when I try to add a new person I get the > following error: > > DatabaseException: ERROR: relation "person_id_seq" does not exist > > SELECT NEXTVAL('person_id_seq') > > Does anyone know what is causing this error? I tried looking for where > it is referenced in the code, but I could not find anything about an > id_seq. > > Rob Campbell > Pacific Coast Wireless Internet > _______________________________________________ > z3-sqlos mailing list > z3-sqlos at codespeak.net > http://codespeak.net/mailman/listinfo/z3-sqlos From rcampbell at pcwi.net Wed Feb 1 20:27:11 2006 From: rcampbell at pcwi.net (Rob Campbell) Date: Wed, 01 Feb 2006 11:27:11 -0800 Subject: [Z3-sqlos] Examples with multiple tables Message-ID: <43E10B8F.5020207@pcwi.net> Hello, I have been trying out the sqlos_sample that is included with sqlos. I was wondering if anyone has any examples of using sqlos with zope3 when there are multiple related tables. One use would be for a contact list. There would be a table for the contact's name, a table for addresses, a table for phone numbers, etc. There also may be a table for groups, so that contacts could be put into groups. I tried taking a look at SIP, but that seems a little complicated to use as an example. I'm just looking for a simple example of using multiple tables in sqlos and zope3. Thank you. Rob Campbell Pacific Coast Wireless Internet From andres at anarazel.de Wed Feb 1 20:53:48 2006 From: andres at anarazel.de (Andres Freund) Date: Wed, 1 Feb 2006 20:53:48 +0100 Subject: [Z3-sqlos] Examples with multiple tables In-Reply-To: <43E10B8F.5020207@pcwi.net> References: <43E10B8F.5020207@pcwi.net> Message-ID: <200602012053.52571.andres@anarazel.de> Hi, On Wednesday 01 February 2006 20:27, Rob Campbell wrote: > I'm just > looking for a simple example of using multiple tables in sqlos and > zope3. Thank you. Where is your problem lying with joins? You just set up join via defining it in your class like this (i just wrote it up, without checking, beware of stupid errors): from sqlobject.joins import ManyToMany, OneToMany class xyz(SQLOS): implements .... abc = ManyToMany("someotherclass") IntCol(.... xyz.abc is now an iterator over the elements of the related class. Greetings, Andres Freund -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-sqlos/attachments/20060201/7309e210/attachment.pgp From jinty at web.de Thu Feb 2 10:46:29 2006 From: jinty at web.de (Brian Sutherland) Date: Thu, 2 Feb 2006 10:46:29 +0100 Subject: [Z3-sqlos] SQL error in sqlos_sample In-Reply-To: <43E10A19.4020107@pcwi.net> References: <43DFA58E.1080501@pcwi.net> <43E10A19.4020107@pcwi.net> Message-ID: <20060202094629.GA7316@minipas.home> On Wed, Feb 01, 2006 at 11:20:57AM -0800, Rob Campbell wrote: > I answered my own question. The sequence was not created by the > included postgres.sql script. So I had to add the sequence manually > with CREATE SEQUENCE person_id_seq. If you post a patch, I'll make sure that it is committed. Unfortunately the example is not functionally tested, so cannot really be maintained easily. > Rob Campbell > Pacific Coast Wireless Internet > > Rob Campbell wrote: > > Hello, > > > > I was just trying out sqlos with Zope 3.2.0 and PostgreSQL 8.0.3. I was > > able to add it to Zope, but when I try to add a new person I get the > > following error: > > > > DatabaseException: ERROR: relation "person_id_seq" does not exist > > > > SELECT NEXTVAL('person_id_seq') > > > > Does anyone know what is causing this error? I tried looking for where > > it is referenced in the code, but I could not find anything about an > > id_seq. > > > > Rob Campbell > > Pacific Coast Wireless Internet > > _______________________________________________ > > z3-sqlos mailing list > > z3-sqlos at codespeak.net > > http://codespeak.net/mailman/listinfo/z3-sqlos > _______________________________________________ > z3-sqlos mailing list > z3-sqlos at codespeak.net > http://codespeak.net/mailman/listinfo/z3-sqlos > -- Brian Sutherland Metropolis - "it's the first movie with a robot. And she's a woman. And she's EVIL!!"