| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
dict --+
|
storage.Storage --+
|
Response
defines the response object and the default values of its members response.write( ) can be used to write in the output html
|
|||
new empty dictionary |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
x.__init__(...) initializes x; see help(type(x)) for signature
|
Caching method for writing out files. By default, caches in ram for 5 minutes. To change, response.cache_includes = (cache_method, time_expire). Example: (cache.disk, 60) # caches to disk for 1 minute. |
if a controller function::
return response.stream(file, 100)
the file content will be streamed at 100 bytes at the time
Optional kwargs:
(for custom stream calls)
attachment=True # Send as attachment. Usually creates a
# pop-up download window on browsers
filename=None # The name for the attachment
Note: for using the stream name (filename) with attachments
the option must be explicitly set as function parameter(will
default to the last request argument otherwise)
|
example of usage in controller:
def download():
return response.download(request, db)
downloads from http://..../download/filename |
assuming:
def add(a, b):
return a+b
if a controller function "func": return response.xmlrpc(request, [add]) the controller will be able to handle xmlrpc requests for the add function. Example:
import xmlrpclib
connection = xmlrpclib.ServerProxy(
'http://hostname/app/contr/func')
print connection.add(3, 4)
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Oct 14 15:17:02 2013 | http://epydoc.sourceforge.net |