request.intargs(i,default,url_onerror=URL(...))

This commit is contained in:
Massimo Di Pierro
2012-04-29 18:51:04 -05:00
parent 67b05a140e
commit 5aaa8bde77
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
Version 1.99.7 (2012-04-24 08:39:47) dev
Version 1.99.7 (2012-04-29 18:49:27) dev
+1 -1
View File
@@ -1,6 +1,6 @@
/** these MUST stay **/
body { margin: 0; padding:0; border: 0; }
a { text-decoration:none: white-space: nowrap;}
a { text-decoration:none; white-space: nowrap;}
a:hover {text-decoration: underline}
a.button {text-decoration: none}
h1,h2,h3,h4,h5,h6 {margin: 0.5em 0 0.25em 0; display: block; font-family: Helvetica}
+9
View File
@@ -94,6 +94,15 @@ 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,