On Friday 20 April 2007 16:59:55 Michael Bayer wrote:
> On Apr 20, 2007, at 5:00 AM, Ram Yalamanchili wrote:
> > I have this piece of code which I came across accidentally:
> >
> > page = 0
> > limit = '1'
> >
> > # note that one of the above values is a string, and the other a
> > 0 data = ATable.select(a_table.c.id.in_(*aIDs), limit=limit,
> > offset= (page*limit))
> >
> > Note the * on strings which is resulting in ''
> >
> > Now this query fails because offset part of the query isn't
> > constructed properly. I think the correct behaviour should be to
> > ignore the offset part of the query?
>
> you mean, select(..., offset='') , should just ignore the offset.
> well no, '' is not a valid argument for offset (valid values are
> None or an integer) so it should raise an error...wouldnt want to
> ignore that.
are strings allowable there at all? e.g. this is like limit='1', 
offset=''...  -> limit is also a string.

note also the .in_(list_that_can_be_empty)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to