On Tue, 22 Nov 2005 10:37:08 -0800 Kevin wrote: > > I understand, and that's what I'm really doing at the moment, but I > was just curious if there's a better way to retrieve these POST > values than just: > > options = [] > for name, value in request.POST.items(): > if(name.startswith("option")): > options.append(value) >
You can simplify that with Python's list comprehensions: options = [value for name, value in request.POST.items() if name.startswith("option")] Luke -- "Outside of a dog, a book is a man's best friend... inside of a dog, it's too dark to read." Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/