request.intargs(i,default,url_onerror=URL(...))
This commit is contained in:
@@ -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,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}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user