OriginalBrownster wrote: > I am using a class called UploadedFile. > I want to create a for loop to itterate through the objects within file > name > > class UploadedFile(SQLObject): > filename = StringCol(alternateID=True) > abspath = StringCol() > uniqueid = IntCol() > > I'll show you a snippit of the code I am trying to use it in:: > > > zip= ["zip.txt"] > file_path = [myfile.filename for myfile in > UploadedFile.select(orderBy=UploadedFile.q.filename)] > > if kw: > for filename in file_path: > zip.append(filename) > flash('Options selected'+ str(kw) + str(zip)) > else: > pass > > When i run this the flash displays all the values for kw...however zip > only shows up as "zip.txt" using the str function. Meaning that the FOR > LOOP is not working correctly.
After your 'file_path =' line, try adding a 'print file_path', and see if it's creating it correctly. Your for loop looks fine, assuming that file_path is a list of filenames. Iain -- http://mail.python.org/mailman/listinfo/python-list