Changes between Version 1 and Version 2 of S3/S3Request


Ignore:
Timestamp:
10/24/10 07:35:22 (14 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Request

    v1 v2  
    11[[TOC]]
    2 = S3XRC - S3Request =
     2[wiki:S3XRC] | [wiki:S3XRC/RESTfulAPI S3 RESTful API] | S3Request
     3= S3Request Class =
    34
    45  - [wiki:S3XRC]
    56
    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 ==
    188
    199The following attributes are set during initialisation of an S3Request object, no further call is required.
    2010
    21 === Controller Attributes ===
     11=== Environment ===
    2212
    23 ||'''rc'''||the resource controller object (''S3ResourceController'')||
    2413||'''request'''||the original web2py request (''Storage'')||
    2514||'''session'''||the current session (''Storage'')||
     
    3625=== Primary Resource Attributes ===
    3726
     27||'''resource'''||the target resource of the request (''S3Resource'')||
    3828||'''prefix'''||the prefix (=module name) of the requested resource (''string'')||
    3929||'''name'''||the name of the requested resource, without prefix (''string'')||
     
    4535=== Component Resource Attributes ===
    4636
    47 ||'''component'''||the requested component, if any (''!ObjectComponent'')||
     37||'''component'''||the requested component, if any (''!S3ResourceComponent'')||
    4838||'''pkey'''||the primary key of the Resource/Component join (''string'')||
    4939||'''fkey'''||the foreign key of the Resource/Component join (''string'')||
     
    5242||'''multiple'''||Flag indicating that multiple component records are allowed (''boolean'')||
    5343
    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:
    6345  - '''prefix''', '''name''', '''tablename''', '''table''' and '''attr''' of the component
    6446  - '''attr''' contains:
    6547    - '''multiple''' Multiple-flag
    66     - '''editable''', '''deletable''' and '''listadd'''
    67     - '''list_fields''', '''rss''', '''main''' and '''extra'''
    68     - '''onaccept''', '''onvalidation''', '''delete_onaccept''' and '''delete_onvalidation'''
    6948  - methods: '''set_attr()''' and '''get_attr()'''
    7049