From fd82097bfcfd24af30a0aba53d9184d41ea61ead Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Mon, 30 Apr 2012 11:39:37 -0500 Subject: [PATCH] request.args(0,default=0, cast=int, url_onerror=URL(...)), thanks Anthony --- VERSION | 2 +- gluon/globals.py | 9 --------- gluon/storage.py | 16 +++++++++++++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/VERSION b/VERSION index 1b0f359e..b2900d9f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-04-29 18:49:27) dev +Version 1.99.7 (2012-04-30 11:39:06) dev diff --git a/gluon/globals.py b/gluon/globals.py index c30df8a7..f265c1da 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -94,15 +94,6 @@ class Request(Storage): self.is_local = False self.global_settings = settings.global_settings - def intargs(self,n,default=None,url_onerror=None): - k = self.args(n) or default - try: - return int(k) - except (ValueError, TypeError): - if url_onerror: - redirect(url_onerror) - raise HTTP(404) - def compute_uuid(self): self.uuid = '%s/%s.%s.%s' % ( self.application, diff --git a/gluon/storage.py b/gluon/storage.py index 1993e029..a83067a4 100644 --- a/gluon/storage.py +++ b/gluon/storage.py @@ -25,11 +25,21 @@ class List(list): instead of IndexOutOfBounds """ - def __call__(self, i, default=None): + def __call__(self, i, default=None, cast=None, url_onerror=None): if 0<=i