sqlobject-discuss Mailing List for SQLObject (Page 377)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(2) |
Mar
(43) |
Apr
(204) |
May
(208) |
Jun
(102) |
Jul
(113) |
Aug
(63) |
Sep
(88) |
Oct
(85) |
Nov
(95) |
Dec
(62) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(38) |
Feb
(93) |
Mar
(125) |
Apr
(89) |
May
(66) |
Jun
(65) |
Jul
(53) |
Aug
(65) |
Sep
(79) |
Oct
(60) |
Nov
(171) |
Dec
(176) |
| 2005 |
Jan
(264) |
Feb
(260) |
Mar
(145) |
Apr
(153) |
May
(192) |
Jun
(166) |
Jul
(265) |
Aug
(340) |
Sep
(300) |
Oct
(469) |
Nov
(316) |
Dec
(235) |
| 2006 |
Jan
(236) |
Feb
(156) |
Mar
(229) |
Apr
(221) |
May
(257) |
Jun
(161) |
Jul
(97) |
Aug
(169) |
Sep
(159) |
Oct
(400) |
Nov
(136) |
Dec
(134) |
| 2007 |
Jan
(152) |
Feb
(101) |
Mar
(115) |
Apr
(120) |
May
(129) |
Jun
(82) |
Jul
(118) |
Aug
(82) |
Sep
(30) |
Oct
(101) |
Nov
(137) |
Dec
(53) |
| 2008 |
Jan
(83) |
Feb
(139) |
Mar
(55) |
Apr
(69) |
May
(82) |
Jun
(31) |
Jul
(66) |
Aug
(30) |
Sep
(21) |
Oct
(37) |
Nov
(41) |
Dec
(65) |
| 2009 |
Jan
(69) |
Feb
(46) |
Mar
(22) |
Apr
(20) |
May
(39) |
Jun
(30) |
Jul
(36) |
Aug
(58) |
Sep
(38) |
Oct
(20) |
Nov
(10) |
Dec
(11) |
| 2010 |
Jan
(24) |
Feb
(63) |
Mar
(22) |
Apr
(72) |
May
(8) |
Jun
(13) |
Jul
(35) |
Aug
(23) |
Sep
(12) |
Oct
(26) |
Nov
(11) |
Dec
(30) |
| 2011 |
Jan
(15) |
Feb
(44) |
Mar
(36) |
Apr
(26) |
May
(27) |
Jun
(10) |
Jul
(28) |
Aug
(12) |
Sep
|
Oct
|
Nov
(17) |
Dec
(16) |
| 2012 |
Jan
(12) |
Feb
(31) |
Mar
(23) |
Apr
(14) |
May
(10) |
Jun
(26) |
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
(6) |
| 2013 |
Jan
(4) |
Feb
(5) |
Mar
|
Apr
(4) |
May
(13) |
Jun
(7) |
Jul
(5) |
Aug
(15) |
Sep
(25) |
Oct
(18) |
Nov
(7) |
Dec
(3) |
| 2014 |
Jan
(1) |
Feb
(5) |
Mar
|
Apr
(3) |
May
(3) |
Jun
(2) |
Jul
(4) |
Aug
(5) |
Sep
|
Oct
(11) |
Nov
|
Dec
(62) |
| 2015 |
Jan
(8) |
Feb
(3) |
Mar
(15) |
Apr
|
May
|
Jun
(6) |
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(19) |
| 2016 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(3) |
Jun
(7) |
Jul
(14) |
Aug
(13) |
Sep
(6) |
Oct
(2) |
Nov
(3) |
Dec
|
| 2017 |
Jan
(6) |
Feb
(14) |
Mar
(2) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(3) |
Dec
|
| 2018 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
(44) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
| 2021 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
|
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2025 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Ivo v. d. W. <vla...@gm...> - 2004-07-19 20:35:37
|
On Thu, 15 Jul 2004 11:50:19 -0400, Roberto Melo Cavalcante <ze...@bo...> wrote: > Hi everybody! > > As you saw on subject, We're wondering if we can use SQLObject on zope2. > That's it. > You can. I'm successfully using SQLObject with Zope and Plone. Perhaps it's not possible to persist SQLObjects in the ZODB, but that doesn't have to be an issue I think. I've been less successfull allowing the import of SQLObject from pythonscripts - I had to hack SQLObject and add some _allow_unprotected_access_to_subobjects to classdefinitions. Ivo -- Drs. I.R. van der Wijk -=- Korte Leidsedwarsstraat 12 Amaze 1017 RC Amsterdam, NL -=- T +31-20-4688336 F +31-20-4688337 Zope/Plone/Content Management W http://www.amaze.nl E in...@am... Open Source Solutions W http://vanderwijk.info E iv...@am... Consultancy PGP http://vanderwijk.info/pgp |
|
From: Ahmed M. A. <ahm...@wa...> - 2004-07-19 18:57:40
|
Hi, With zope 2.7 and prior you cannot.Anyway,it not worked for me because of the python 2.3 new style class. (ClassSecurityInfo cannot write to __dict__).I heard that the problem will be solved with Zope 2.8.For our project,we cannot wait for this release nor for zope 3 release. So,i switched to webware. Ahmed MOHAMED ALI -----Message d'origine----- De : sql...@li... [mailto:sql...@li...]De la part de Roberto Melo Cavalcante Envoye : jeudi 15 juillet 2004 17:50 A : sql...@li... Objet : [SQLObject] Can SQLObject used on zope-2.7? Hi everybody! As you saw on subject, We're wondering if we can use SQLObject on zope2. That's it. Thank you for your help Roberto ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ sqlobject-discuss mailing list sql...@li... https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss |
|
From: Roberto M. C. <ze...@bo...> - 2004-07-19 18:13:41
|
Hi everybody! As you saw on subject, We're wondering if we can use SQLObject on zope2. That's it. Thank you for your help Roberto |
|
From: Sidnei da S. <si...@aw...> - 2004-07-19 14:36:37
|
On Mon, Jul 19, 2004 at 07:27:11AM -0700, Michael Watkins wrote: | For my purposes I created a singleton class pattern which has a | get_connection() method and assigns the result of this to each | SQLObject's _connection property. I have used a descriptor for _connection which fetches a connection from a global per-thread connection cache. -- Sidnei da Silva <si...@aw...> http://awkly.org - dreamcatching :: making your dreams come true http://www.enfoldsystems.com http://plone.org/about/team#dreamcatcher <Intention> How EXACTLY are cameras used to keep planes from hitting skyscrapers? Do they have laser attatchments? |
|
From: Michael W. <mw...@mi...> - 2004-07-19 14:27:26
|
Is there any reason why you are opening so many connections? In a typical long-running web app I have 2 - 4 connections open max (depending on how many processes SCGI - I use Quixote - has forked), even when the app runs for many days without restarting. I've not looked closely at the __connection__ magic variable to know how that behaves. For my purposes I created a singleton class pattern which has a get_connection() method and assigns the result of this to each SQLObject's _connection property. On Mon, 2004-07-19 at 04:11, Florian Schulze wrote: > Hi! > > Is anyone using SQLObject with long running processes which open many > (short lived) connections? Currently there seems to be no way to really > close connections. Sooner or later I get errors about to many connections > to the database and many many idle database processes. > > I'm using SQLObject from Subversion (Rev 163) with Postgresql (psycopg). > > Regards, > Florian Schulze > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss -- Mike Watkins mw...@mi... Here in my heart, I am Helen; I'm Aspasia and Hero, at least. I'm Judith, and Jael, and Madame de Sta"el; I'm Salome, moon of the East. Here in my soul I am Sappho; Lady Hamilton am I, as well. In me R'ecamier vies with Kitty O'Shea, With Dido, and Eve, and poor nell. I'm all of the glamorous ladies At whose beckoning history shook. But you are a man, and see only my pan, So I stay at home with a book. -- Dorothy Parker |
|
From: Ahmed M. A. <ahm...@wa...> - 2004-07-19 11:54:46
|
Hi Florian , I'am using MaxDB database and i have encountered some problems with the connection. Sometimes,my connection object become invalid.I fixed with the next patch;I don't know if this will solve your problem. Anyway,let me know if it solves. file : sqlobject/dbconnection.py method: DBAPI.releaseConnection [-] if self._pool is None: [+] if not self._pool: [-] if self._pool is not None: [+] if self._pool : Ahmed MOHAMED ALI "Florian Schulze" <flo...@gm...> wrote in message news:ops...@nw...... > Hi! > > Is anyone using SQLObject with long running processes which open many > (short lived) connections? Currently there seems to be no way to really > close connections. Sooner or later I get errors about to many connections > to the database and many many idle database processes. > > I'm using SQLObject from Subversion (Rev 163) with Postgresql (psycopg). > > Regards, > Florian Schulze > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click |
|
From: Florian S. <flo...@gm...> - 2004-07-19 11:20:23
|
On Wed, 14 Jul 2004 11:18:38 +0200, Ivo van der Wijk <vla...@gm...> wrote: > Are you sure your SQL statement is correct? If you enable debug > (debug=1 in your connection), will the generated SQL work from a > standard sql client? I have checked and the SQL is correct. Regards, Florian Schulze |
|
From: Florian S. <flo...@gm...> - 2004-07-19 11:07:54
|
Hi! Is anyone using SQLObject with long running processes which open many (short lived) connections? Currently there seems to be no way to really close connections. Sooner or later I get errors about to many connections to the database and many many idle database processes. I'm using SQLObject from Subversion (Rev 163) with Postgresql (psycopg). Regards, Florian Schulze |
|
From: Andrey L. <an...@mi...> - 2004-07-18 20:26:41
|
On Sun, Jul 18, 2004 at 01:50:43PM -0500, Charles Brandt wrote:
> Hi Andrey,
>
> > I must admit this way of doing things is terribly unscalable. Isn't it
> > better to do single "SELECT id, dn, discount, ... FROM customer WHERE
> > pricing = 4"? Or am I doing something wrong?
> >
>
> I think the behavior that you're observing is in fact the way that SQLObject
> does things. The reason being if your select were to return thousands of
> rows of data but you only need the first 10, 10 specific calls would be more
> efficient than grabbing all 1000 rows. (Especially by reusing the same
> connection?) I'm no database expert though...
I'm no database expert too, but I feel that not always true. Each query
consists of transferring over wires, syntax parsing, planning,
optimizing, locking and unlocking tables, etc. Fetching records one by
one, generating masses of queries is not a way to go IMHO. Again, I have
no benchmark results whatsoever, just intuition.
>
> From the docs:
>
> "Select results are generators, which are lazily evaluated. So the SQL is
> only executed when you iterate over the select results, or if you use list()
> to force the result to be executed. When you iterate over the select
> results, rows are fetched one at a time. This way you can iterate over large
> results without keeping the entire result set in memory. You can also do
> things like .reversed() without fetching and reversing the entire result --
> instead, SQLObject can change the SQL that is sent so you get equivalent
> results.
> You can also slice select results. The results are used in the SQL query, so
> peeps[:10] will result in LIMIT 10 being added to the end of the SQL query.
> If the slice cannot be performed in the SQL (e.g., peeps[:-10]), then the
> select is executed, and the slice is performed on the list of results. This
> will only happen when you use negative indexes."
Well, I'm afraid that's not really a case. At least [:n] notion doesn't
work here (doesn't result in LIMIT statement). When I change driver
script to::
pricings = Pricing.select()
for prsg in pricings:
print prsg.id
print prsg.customers[:10]
script still generates lots and lots of "SELECT dn, balance, pricing
FROM customer WHERE id = 160"-like statements.
Join.py line 100:
def performJoin(self, inst):
ids = inst._connection._SO_selectJoin(
self.otherClass,
self.joinColumn,
inst.id)
if inst._SO_perConnection:
conn = inst._connection
else:
conn = None
return self._applyOrderBy([self.otherClass(id, conn) for (id,) in ids if id is not None], self.otherClass)
I can see no way where LIMIT statement or similar python limiting mechanism is
inserted. I can be wrong here of course.
I'm using SQLObject-0.5.2 and python-3.3.4
I'm currently looking at several object-relational mappers for python
and "usage" part of SQLObject is cleanly the best! But I'm a bit afraid
to base big and somewhat performance dependant project on it...
BTW, do you aware of any MSSQL Server 2000 connectors for SQLObject?
Thanks
--
Andrey Lebedev aka -.- . -.. -.. . .-.
Software engineer at UAB Mikromarketingas (http://micro.lt)
Homepage: http://micro.lt/~andrey/
Jabber ID: ke...@ja...
|
|
From: Charles B. <li...@st...> - 2004-07-18 18:50:49
|
Hi Andrey, > I must admit this way of doing things is terribly unscalable. Isn't it > better to do single "SELECT id, dn, discount, ... FROM customer WHERE > pricing = 4"? Or am I doing something wrong? > I think the behavior that you're observing is in fact the way that SQLObject does things. The reason being if your select were to return thousands of rows of data but you only need the first 10, 10 specific calls would be more efficient than grabbing all 1000 rows. (Especially by reusing the same connection?) I'm no database expert though... From the docs: "Select results are generators, which are lazily evaluated. So the SQL is only executed when you iterate over the select results, or if you use list() to force the result to be executed. When you iterate over the select results, rows are fetched one at a time. This way you can iterate over large results without keeping the entire result set in memory. You can also do things like .reversed() without fetching and reversing the entire result -- instead, SQLObject can change the SQL that is sent so you get equivalent results. You can also slice select results. The results are used in the SQL query, so peeps[:10] will result in LIMIT 10 being added to the end of the SQL query. If the slice cannot be performed in the SQL (e.g., peeps[:-10]), then the select is executed, and the slice is performed on the list of results. This will only happen when you use negative indexes." Hope that helps... -Charles. |
|
From: Andrey L. <an...@mi...> - 2004-07-18 17:20:14
|
Hi,
I'm evaluating SQLObject and it MultipleJoin functionality works in
highly inefficient way for me. I have the following simple postgresql
database:
CREATE TABLE public.customer
(
id serial NOT NULL,
dn varchar(255) NOT NULL,
title varchar(255),
discount int2,
pricing int4,
balance float8 NOT NULL DEFAULT 0,
CONSTRAINT customer_pkey PRIMARY KEY (id),
CONSTRAINT "$1" FOREIGN KEY (pricing) REFERENCES public.pricing (id) ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY IMMEDIATE,
CONSTRAINT customer_dn_key UNIQUE (dn)
)
CREATE TABLE public.pricing
(
id serial NOT NULL,
date date NOT NULL,
description text,
CONSTRAINT pricing_pkey PRIMARY KEY (id)
)
And theese SQLObject classes:
class Customer(SQLObject):
dn = StringCol()
balance = FloatCol()
pricing = ForeignKey('Pricing', dbName='pricing')
class Pricing(SQLObject):
date = DateCol()
description = StringCol()
customers = MultipleJoin('Customer', joinColumn='pricing')
So, now the problem:
When I do:
pricings = Pricing.select()
for prsg in pricings:
print prsg.customers
SQLObjects first fetches list of ids in 'customer' table and then executes
additional queries for EACH found id, like this:
2/QueryAll: SELECT id FROM customer WHERE pricing = 4
2/COMMIT : auto
2/QueryOne: SELECT dn, discount, balance, pricing FROM customer WHERE id = 28
2/COMMIT : auto
2/QueryOne: SELECT dn, discount, balance, pricing FROM customer WHERE id = 2
2/COMMIT : auto
2/QueryOne: SELECT dn, discount, balance, pricing FROM customer WHERE id = 187
2/COMMIT : auto
2/QueryOne: SELECT dn, discount, balance, pricing FROM customer WHERE id = 186
2/COMMIT : auto
2/QueryOne: SELECT dn, discount, balance, pricing FROM customer WHERE id = 170
2/COMMIT : auto
2/QueryOne: SELECT dn, discount, balance, pricing FROM customer WHERE id = 161
...
...
I must admit this way of doing things is terribly unscalable. Isn't it
better to do single "SELECT id, dn, discount, ... FROM customer WHERE
pricing = 4"? Or am I doing something wrong?
Thanks in advance.
--
Andrey Lebedev aka -.- . -.. -.. . .-.
Software engineer at UAB Mikromarketingas (http://micro.lt)
Homepage: http://micro.lt/~andrey/
Jabber ID: ke...@ja...
|
|
From: Peter W. <pw-...@te...> - 2004-07-18 02:46:03
|
On 18/07/2004, at 9:09 AM, Michael Kent wrote: > When I made the following patch, the problem disappeared. I'd > appreciate it if someone could > check me on this. It seems strange that this problem could exist. > Surely someone else > must be using SQLObject with MySQL. I had to do the exactly same thing a couple of days ago, has been working fine for me too. -- Peter Wilkinson. |
|
From: Michael K. <mrm...@co...> - 2004-07-17 23:09:41
|
Hello all, I needed to do some Python database work. I set up for it on my Mandrake Linux 10 box by makeing sure MySQL 4.1 was working correctly (yes), installing MySQLdb 1.1.1 from http://sourceforge.net/projects/mysql-python and making sure it worked correctly (yes), then installing SQLObject 0.5.2. After going thru the learning curve on SQLObject, I hit a brick wall, where I'd get a AttributeError exception, telling me that a Cursor object does not have an 'insert_id' method. I then got the latest version of SQLObject from the svn 'trunk' repository. This did not fix the problem. Examining the SQLObject source, I found that the _queryInsertID method of mysql/mysqlconnection.py does call insert_id() as a method of an instance of the cursor class. Examining the MySQLdb source, I found that the Cursor class does not have such a method, that instead it is a method of the Connection class. When a cursor's execute() method is called, the code calls the connections insert_id() method, and then stores the value in the cursor's 'lastrowid' attribute. So the solution for SQLObject appears to be to use the 'lastrowid' attribute of the cursor class, rather than trying to call the cursor class's non-existant insert_id() method. When I made the following patch, the problem disappeared. I'd appreciate it if someone could check me on this. It seems strange that this problem could exist. Surely someone else must be using SQLObject with MySQL. Index: sqlobject/mysql/mysqlconnection.py =================================================================== --- sqlobject/mysql/mysqlconnection.py (revision 163) +++ sqlobject/mysql/mysqlconnection.py (working copy) @@ -50,7 +50,7 @@ self.printDebug(conn, q, 'QueryIns') self._executeRetry(conn, c, q) if id is None: - id = c.insert_id() + id = c.lastrowid if self.debugOutput: self.printDebug(conn, id, 'QueryIns', 'result') return id -- Give a man a fish, and he'll eat for a day. TEACH a man to fish, and he'll decide it's too much trouble, and take your fish. |
|
From: Michael W. <mw...@mi...> - 2004-07-15 18:15:41
|
ps: svn co svn://colorstudy.com/trunk/SQLObject Is working just fine at the moment. -- Mike Watkins FreeBSD: It's 3am at night. Do you know where your fairings are? |
|
From: Michael W. <mw...@tr...> - 2004-07-15 18:10:54
|
Florian:
> I get an error when I try to get an element from a select.
>
> result = Klassname.select(<statements>)
> result[0] <---- here
>
> I get TypeError: Iteration over non-sequence
I'm using svn version from ... I can't remember, here is my result:
>>> r = Content.select('id = 202020')
>>> r[0]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/www/lib/sqlobject/main.py", line 1191, in __getitem__
return list(self.clone(start=start, end=start+1))[0]
IndexError: list index out of range
In the meantime:
result = list(Klassname.select(<statements>))
Will deliver what you want I think.
--
Michael Watkins
TrendVue.com
mw...@tr...
|
|
From: Ivo v. d. W. <vla...@gm...> - 2004-07-14 09:18:46
|
On Tue, 13 Jul 2004 16:08:45 +0200, Florian Schulze <flo...@gm...> wrote: > I get an error when I try to get an element from a select. > > result = Klassname.select(<statements>) > result[0] <---- here > > I get TypeError: Iteration over non-sequence > > It seems like the Iteration object returns None in dbconnection.iterSelect > and the list(Iteration(...)) fails because of that. > Are you sure your SQL statement is correct? If you enable debug (debug=1 in your connection), will the generated SQL work from a standard sql client? Cheers Ivo -- Drs. I.R. van der Wijk -=- Korte Leidsedwarsstraat 12 Amaze 1017 RC Amsterdam, NL -=- T +31-20-4688336 F +31-20-4688337 Zope/Plone/Content Management W http://www.amaze.nl E in...@am... Open Source Solutions W http://vanderwijk.info E iv...@am... Consultancy PGP http://vanderwijk.info/pgp |
|
From: Florian S. <flo...@gm...> - 2004-07-14 06:30:38
|
On Wed, 14 Jul 2004 08:30:48 +0200, Florian Schulze <flo...@gm...> wrote: > On Tue, 13 Jul 2004 07:56:12 -0700, Karl Chen <qu...@no...> > wrote: > >>>>>>> "Florian" == Florian Schulze <flo...@gm...> >>>>>>> writes: >> Florian> Then it should return an empty list and raise an >> Florian> IndexError, the current behaviour is wrong. And as >> Florian> far as I can see in the next function of Iteration it >> Florian> checks for an empty select and immediatly raises >> Florian> StopIteration, so this can't be the problem. >> >> Ok never mind. Try the sqlobject branch from here: >> >> http://svn.quarl.org/repos/coursesurvey/trunk/coursesurvey/scripts/sqlobject > > I can't check it out, > http://svn.quarl.org/repos_html/coursesurvey/trunk/coursesurvey/scripts/sqlobject/ > also doesn't work. Ups, forgot to post the error message: svn: REPORT request failed on '/repos_html/coursesurvey/!svn/vcc/default' svn: REPORT of '/repos_html/coursesurvey/!svn/vcc/default': 400 Bad Request (http://svn.quarl.org) The same for the other URL. Regards, Florian Schulze |
|
From: Florian S. <flo...@gm...> - 2004-07-14 06:27:54
|
On Tue, 13 Jul 2004 07:56:12 -0700, Karl Chen <qu...@no...> wrote: >>>>>> "Florian" == Florian Schulze <flo...@gm...> writes: > Florian> Then it should return an empty list and raise an > Florian> IndexError, the current behaviour is wrong. And as > Florian> far as I can see in the next function of Iteration it > Florian> checks for an empty select and immediatly raises > Florian> StopIteration, so this can't be the problem. > > Ok never mind. Try the sqlobject branch from here: > > http://svn.quarl.org/repos/coursesurvey/trunk/coursesurvey/scripts/sqlobject I can't check it out, http://svn.quarl.org/repos_html/coursesurvey/trunk/coursesurvey/scripts/sqlobject/ also doesn't work. Regards, Florian Schulze |
|
From: Karl C. <qu...@no...> - 2004-07-13 14:56:17
|
>>>>> "Florian" == Florian Schulze <flo...@gm...> writes:
Florian> Then it should return an empty list and raise an
Florian> IndexError, the current behaviour is wrong. And as
Florian> far as I can see in the next function of Iteration it
Florian> checks for an empty select and immediatly raises
Florian> StopIteration, so this can't be the problem.
Ok never mind. Try the sqlobject branch from here:
http://svn.quarl.org/repos/coursesurvey/trunk/coursesurvey/scripts/sqlobject
Does it have the same problem? (I fixed some bugs regarding
returning None a long time ago; there is a lot of stuff to merge
into the sqlobject trunk)
--
Karl 2004-07-13 07:53
|
|
From: Karl C. <qu...@no...> - 2004-07-13 14:41:21
|
>>>>> "Florian" == Florian Schulze <flo...@gm...> writes:
Florian> 1. All those "...Connection" compatibility functions
Florian> in __init__.py don't return the connection object,
Florian> the return is simply missing. I posted a bug
Florian> report (990062).
Fixed
--
Karl 2004-07-13 07:34
|
|
From: Florian S. <flo...@gm...> - 2004-07-13 14:37:24
|
On Tue, 13 Jul 2004 07:30:14 -0700, Karl Chen <qu...@no...> wrote: > > > This only happens when the select returns empty. You can do > either a try/except or do a count first. Then it should return an empty list and raise an IndexError, the current behaviour is wrong. And as far as I can see in the next function of Iteration it checks for an empty select and immediatly raises StopIteration, so this can't be the problem. Florian Schulze |
|
From: Karl C. <qu...@no...> - 2004-07-13 14:30:24
|
This only happens when the select returns empty. You can do
either a try/except or do a count first.
>>>>> "Florian" == Florian Schulze <flo...@gm...> writes:
Florian>
Florian> I get an error when I try to get an element from a
Florian> select. result = Klassname.select(<statements>)
Florian> result[0] <---- here
Florian>
Florian> I get TypeError: Iteration over non-sequence
Florian>
Florian> It seems like the Iteration object returns None in
Florian> dbconnection.iterSelect and the list(Iteration(...))
Florian> fails because of that.
--
Karl 2004-07-13 07:29
|
|
From: Florian S. <flo...@gm...> - 2004-07-13 14:10:32
|
I get an error when I try to get an element from a select. result = Klassname.select(<statements>) result[0] <---- here I get TypeError: Iteration over non-sequence It seems like the Iteration object returns None in dbconnection.iterSelect and the list(Iteration(...)) fails because of that. I use svn checkout from a few hours ago. I would stay with 0.5.2, but there are no cleanup functions and I get leaking connections because of that. Regards, Florian Schulze |
|
From: Florian S. <flo...@gm...> - 2004-07-13 14:02:12
|
> I found this somewhere (but now I don't remember where, maybe it was > the code for those compatibility functions). > type://user:pass@host:port/dbname > eg : > postgres://me:secret@localhost/mydb Yes, this is it. Thanks, Florian Schulze |
|
From: Derrick 'd. H. <dm...@dm...> - 2004-07-13 12:46:46
|
On Tue, Jul 13, 2004 at 12:57:50PM +0200, Florian Schulze wrote:
| Hi!
|=20
| I just got the latest source from svn and got some problems.
|=20
| 1. All those "...Connection" compatibility functions in __init__.py don't=
=20
| return the connection object, the return is simply missing. I posted a bu=
g =20
| report (990062).
| 2. Till I found that out, I tried connectionForURI, but I can't figure ou=
t =20
| the format of the URI string. There is no documentation string and I =20
| couldn't find it in the other docs.
I found this somewhere (but now I don't remember where, maybe it was
the code for those compatibility functions).
type://user:pass@host:port/dbname
eg :
postgres://me:secret@localhost/mydb
-D
--=20
If anyone would come after me, he must deny himself and take up his
cross and follow me. For whoever wants to save his life will lose it,
but whoever loses his life for me and for the gospel will save it. What
good is it for a man to gain the whole world, yet forfeit his soul? Or
what can a man give in exchange for his soul?
Mark 8:34-37
=20
www: http://dman13.dyndns.org/~dman/ jabber: dm...@dm....=
org
|