= S3Request Class = [[TOC]] == Attributes of S3Request == The following attributes are set during initialisation of an S3Request object, no further call is required. === Environment === ||'''request'''||the original web2py request (''Storage'')|| ||'''session'''||the current session (''Storage'')|| ||'''response'''||the web2py response (''Storage'')|| === Request Attributes === ||'''representation'''||the current representation of this request (''string'', lowercase)|| ||'''http'''||the HTTP method of this request (''string'', always uppercase!)|| ||'''extension'''||the extension found in the original request (''string'', lowercase)|| ||'''method'''||the method of the request if not HTTP (''string'', always lowercase)|| ||'''custom_action'''||the custom method handler for the request (''function'' or ''lambda'')|| === Primary Resource Attributes === ||'''resource'''||the target resource of the request (''S3Resource'')|| ||'''prefix'''||the prefix (=module name) of the requested resource (''string'')|| ||'''name'''||the name of the requested resource, without prefix (''string'')|| ||'''tablename'''||the name of the primary table (''string'')|| ||'''table'''||the primary table (''Table'')|| ||'''id'''||the ID of the primary record (''int'')|| ||'''record'''||the primary record (''Row'')|| === Component Resource Attributes === ||'''component'''||the requested component, if any (''!S3ResourceComponent'')|| ||'''pkey'''||the primary key of the Resource/Component join (''string'')|| ||'''fkey'''||the foreign key of the Resource/Component join (''string'')|| ||'''component_name'''||the name of the component without prefix (''string'')|| ||'''component_id'''||the ID of the component record as of the request, if any (''int'')|| ||'''multiple'''||Flag indicating that multiple component records are allowed (''boolean'')|| '''!S3ResourceComponent''' contains: - '''prefix''', '''name''', '''tablename''', '''table''' and '''attr''' of the component - '''attr''' contains: - '''multiple''' Multiple-flag - methods: '''set_attr()''' and '''get_attr()''' == Methods of the S3Request == === Magic URLs === '''here(representation=None)''' - returns the URL of the current request '''there(representation=None)''' - returns the URL of a HTTP GET request for the same resource '''same(representation=None)''' - returns the URL of the current request with the primary record ID replaced by the string literal '[id]' '''other(method=None, record_id=None, representation=None)''' - returns the URL of a request with another method and record ID, but for the same resource === Other functions === '''target()''' - returns the target table of the current request as tuple of (prefix, name, table, tablename)