Changes between Version 1 and Version 2 of S3/S3Request
- Timestamp:
- 10/24/10 07:35:22 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/S3Request
v1 v2 1 1 [[TOC]] 2 = S3XRC - S3Request = 2 [wiki:S3XRC] | [wiki:S3XRC/RESTfulAPI S3 RESTful API] | S3Request 3 = S3Request Class = 3 4 4 5 - [wiki:S3XRC] 5 6 6 == S3Request and Method Handlers == 7 8 When method handlers are called by the [wiki:S3XRC_S3Resource#RESTInterface REST interface], they get a S3Request object passed as the first argument, usually named "r" or "jr": 9 10 {{{ 11 def method_handler(r, **attr): 12 }}} 13 14 This S3Request instance represents the request to be executed, and it contains references to all data necessary to perform the requested action. 15 16 ''Note: All method handlers receive the same list of arguments, regardless of whether they are standard CRUD or custom method handlers.'' 17 == Attributes of the S3Request == 7 == Attributes of S3Request == 18 8 19 9 The following attributes are set during initialisation of an S3Request object, no further call is required. 20 10 21 === Controller Attributes===11 === Environment === 22 12 23 ||'''rc'''||the resource controller object (''S3ResourceController'')||24 13 ||'''request'''||the original web2py request (''Storage'')|| 25 14 ||'''session'''||the current session (''Storage'')|| … … 36 25 === Primary Resource Attributes === 37 26 27 ||'''resource'''||the target resource of the request (''S3Resource'')|| 38 28 ||'''prefix'''||the prefix (=module name) of the requested resource (''string'')|| 39 29 ||'''name'''||the name of the requested resource, without prefix (''string'')|| … … 45 35 === Component Resource Attributes === 46 36 47 ||'''component'''||the requested component, if any (''! ObjectComponent'')||37 ||'''component'''||the requested component, if any (''!S3ResourceComponent'')|| 48 38 ||'''pkey'''||the primary key of the Resource/Component join (''string'')|| 49 39 ||'''fkey'''||the foreign key of the Resource/Component join (''string'')|| … … 52 42 ||'''multiple'''||Flag indicating that multiple component records are allowed (''boolean'')|| 53 43 54 === Error Indicators === 55 56 ||'''error'''||the last error message (''string'')|| 57 ||'''invalid'''||Flag indicating this request as invalid (''boolean'')|| 58 ||'''badmethod'''||Flag indicating a bad method error (''boolean'')|| 59 ||'''badrecord'''||Flag indicating a invalid record ID error (''boolean'')|| 60 ||'''badrequest'''||Flag indicating an unqualified request error (''boolean'')|| 61 62 '''!ObjectComponent''' contains: 44 '''!S3ResourceComponent''' contains: 63 45 - '''prefix''', '''name''', '''tablename''', '''table''' and '''attr''' of the component 64 46 - '''attr''' contains: 65 47 - '''multiple''' Multiple-flag 66 - '''editable''', '''deletable''' and '''listadd'''67 - '''list_fields''', '''rss''', '''main''' and '''extra'''68 - '''onaccept''', '''onvalidation''', '''delete_onaccept''' and '''delete_onvalidation'''69 48 - methods: '''set_attr()''' and '''get_attr()''' 70 49