Re: quick newbie syntax question

2008-10-20 Thread Steven D'Aprano
On Mon, 20 Oct 2008 12:24:14 -0700, Robocop wrote: > oops! Sorry about that, i should have just copied my code directly. I > actually did specify an int in range: >> > year = '2008' >> > month = '09' >> > limit = '31' >> > for i in range(1,int(limit)): > > The code is currently failing due to t

Re: quick newbie syntax question

2008-10-20 Thread Robocop
date = "%s-%s-%s" % (year, month, i) is exactly what i'd like to do. The Table object will just be a mysql table, and the filter function will yield a list filtered for those dates. For my purposes the limit variable will not be static, depending on which day of the month it is i will only want it

Re: quick newbie syntax question

2008-10-20 Thread Larry Bates
Robocop wrote: oops! Sorry about that, i should have just copied my code directly. I actually did specify an int in range: year = '2008' month = '09' limit = '31' for i in range(1,int(limit)): The code is currently failing due to the syntax in the filter, particularly the section "date = yea

Re: quick newbie syntax question

2008-10-20 Thread Robocop
oops! Sorry about that, i should have just copied my code directly. I actually did specify an int in range: > > year = '2008' > > month = '09' > > limit = '31' > > for i in range(1,int(limit)): The code is currently failing due to the syntax in the filter, particularly the section "date = year'-

Re: quick newbie syntax question

2008-10-20 Thread Chris Rebert
On Mon, Oct 20, 2008 at 12:08 PM, Robocop <[EMAIL PROTECTED]> wrote: > Is it possible to do something like this syntactically: > > year = '2008' > month = '09' > limit = '31' > for i in range(1,limit): This previous line will fail. range() takes numbers, not strings. Change 'limit' to an int. >

quick newbie syntax question

2008-10-20 Thread Robocop
Is it possible to do something like this syntactically: year = '2008' month = '09' limit = '31' for i in range(1,limit): temp = Table.objects.filter(date = year'-'month'-'i)