|
From: Matt G. <ma...@po...> - 2003-06-30 14:51:39
|
and forcing queryOne()[0] to an int (as below) fixes the len() problem
for SQLite. That works fine with PostgreSQL and I can't think of a
reason why it would break anything else.
def countSelect(self, select):
q = "SELECT COUNT(*) FROM %s WHERE %s" % \
(", ".join(select.tables),
self.whereClauseForSelect(select, limit=0, order=0))
val = int(self.queryOne(q)[0])
if self.debug:
print "COUNT results:", val
return val
Cheers, Matt
Matt Goodall wrote:
> Using:
> python 2.2.2
> sqlite 2.8.3
> pysqlite 0.4.3
> SQLObject 0.4rc1
>
> SQLite support seems a bit broken ...
>
> len(Person.select('all')) - "TypeError: an integer is required". I
> guess this is because SQLite always uses strings.
>
> Also, when a slice does not include an upper bound, i.e.
> Person.select('all')[10:] or Person.select('all')[1], the generated
> SQL is missing the LIMIT part of the clause. According to the SQLite
> docs it should include "LIMIT 0" if there is no upper bound.
>
> All of the above work fine with PostgreSQL.
>
> Cheers, Matt
>
> Ian Bicking wrote:
>
>> I believe I have everything together for SQLObject 0.4 A release
>> candidate exists at:
>>
>> http://colorstudy.com/SQLObject-0.4rc1.tar.gz
>>
>> I'd appreciate it people could give it a try, to see if there's problems
>> with the distribution or anything else. I've also restructured and
>> rewritten a lot of the documentation, so I'd appreciate any feedback
>> anyone has on that as well.
>>
>> The changes are described in News.txt
>>
>> Ian
>>
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>> Data Reports, E-commerce, Portals, and Forums are available now.
>> Download today and enter to win an XBOX or Visual Studio .NET.
>> http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
>> _______________________________________________
>> sqlobject-discuss mailing list
>> sql...@li...
>> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
>>
>>
>
--
Matt Goodall, Pollenation Internet Ltd
e: ma...@po...
t: 0113 2252500
|