On 21 Nov 2005, at 02:08, Robert Wittams wrote:

from django.core import input

a = request.GET.get('a', 0).as(input.int)
a_list = request.GET.get_list('a', 0).as(input.int)

That syntax looks pretty smart to me. It's definitely extensible - it would be trivial to define your own input filter object and pass it to the 'as' function.

To make sure 0 can be returned if the filtering fails it would have to be stored in a property of the intermediate object.

Reply via email to