-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasics.py
More file actions
37 lines (33 loc) · 903 Bytes
/
basics.py
File metadata and controls
37 lines (33 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
# try something like
def request_vars():
num1 = 0
num2 = 0
total = 0
if request.post_vars:
num1 = float(request.post_vars.num1)
num2 = float(request.post_vars.num2)
total = num1 + num2
response.flash = T("The total is " + str(total))
return locals()
"
def request_args():
arg1 = float(request.args(0))
arg2 = float(request.args(1))
total = arg1 + arg2
return locals()
def request_object():
app = request.application
cntr = request.controller
fx = request.function
ext = request.extension
folder = request.folder
now = request.now
client = request.client
isSecure = request.is_https
return locals()
def helloworld():
msg = "hello from the controller"
return locals()
def index():
return dict(message="hello from basics.py"