Thanks guys, but for the record I know missing keys on request.vars wasn't returning None in 1.99.2, and when I upgraded it broke my code. Does anyone have an explanation?
On Jan 3, 1:48 pm, Ross Peoples <ross.peop...@gmail.com> wrote: > Bruno is correct, and that's the whole point of Storage is that you don't > have to test request.vars, you just call it. Alternatively, you can treat > Storage just like any other dict(). > > For your example, there are many ways to solve the above example: > > if 'sort' in request.vars: > sort = request.vars.sort > else: > sort = 'created' > > And then there's the one-line solution: > > sort = request.vars.get('sort', 'created') > > This line accomplishes the same thing, except better. If request.vars has > 'sort', then return its value, otherwise return 'created'.