| 14 | === Attributes === |
| 15 | |
| 16 | ||'''rc'''||the resource controller object (''S3XRC'')|| |
| 17 | ||'''prefix'''||the prefix (=module name) of the requested resource (''string'')|| |
| 18 | ||'''name'''||the name of the requested resource, without prefix (''string'')|| |
| 19 | ||'''request'''||the original web2py request (''Storage'')|| |
| 20 | ||'''session'''||the current session (''Storage'')|| |
| 21 | ||'''error'''||the last error message (''string'')|| |
| 22 | ||'''invalid'''||Flag indicating this request as invalid (''boolean'')|| |
| 23 | ||'''badmethod'''||Flag indicating a bad method error (''boolean'')|| |
| 24 | ||'''badrecord'''||Flag indicating a invalid record ID error (''boolean'')|| |
| 25 | ||'''badrequest'''||Flag indicating an unqualified request error (''boolean'')|| |
| 26 | ||'''representation'''||the current representation of this request (''string'', lowercase)|| |
| 27 | ||'''http'''||the HTTP method of this request (''string'', always uppercase!)|| |
| 28 | ||'''extension'''||the extension found in the original request (''string'', lowercase)|| |
| 29 | ||'''tablename'''||the name of the primary table (''string'')|| |
| 30 | ||'''table'''||the primary table (''Table'')|| |
| 31 | ||'''method'''||the method of the request if not HTTP (''string'', always lowercase)|| |
| 32 | ||'''id'''||the ID of the primary record (''int'')|| |
| 33 | ||'''record'''||the primary record (''Row'')|| |
| 34 | ||'''component'''||the requested component, if any (''!ObjectComponent'')|| |
| 35 | ||'''pkey'''||the primary key of the Resource/Component join (''string'')|| |
| 36 | ||'''fkey'''||the foreign key of the Resource/Component join (''string'')|| |
| 37 | ||'''component_name'''||the name of the component without prefix (''string'')|| |
| 38 | ||'''component_id'''||the ID of the component record as of the request, if any (''int'')|| |
| 39 | ||'''multiple'''||Flag indicating that multiple component records are allowed (''boolean'')|| |
| 40 | ||'''custom_action'''||the custom method handler for the request (''function'' or ''lambda'')|| |
| 41 | |
| 42 | '''!ObjectComponent''' contains: |
| 43 | - '''prefix''', '''name''', '''table_name''', '''table''' and '''attr''' of the component |
| 44 | - '''attr''' contains: |
| 45 | - '''multiple''' Multiple-flag |
| 46 | - '''editable''', '''deletable''' and '''listadd''' |
| 47 | - '''list_fields''', '''rss''', '''main''' and '''extra''' |
| 48 | - '''onaccept''', '''onvalidation''', '''delete_onaccept''' and '''delete_onvalidation''' |
| 49 | - methods: '''set_attr()''' and '''get_attr()''' |
| 50 | |
| 51 | === Methods === |
| 52 | |
| 53 | '''here(representation=None)''' |
| 54 | - returns the URL of the current request |
| 55 | |
| 56 | '''there(representation=None)''' |
| 57 | - returns the URL of a HTTP GET request for the same resource |
| 58 | |
| 59 | '''same(representation=None)''' |
| 60 | - returns the URL of the current request with the primary record ID replaced by the string literal '[id]' |
| 61 | |
| 62 | '''other(method=None, record_id=None, representation=None)''' |
| 63 | - returns the URL of a request with another method and record ID, but for the same resource |
| 64 | |
| 65 | '''target()''' |
| 66 | - returns the target table of the current request as tuple of (prefix, name, table, tablename) |
| 67 | |
| 68 | '''export_xml(permit=None, audit=None, template=None, filterby=None, pretty_print=False)''' |
| 69 | - exports the requested resources as XML |
| 70 | |
| 71 | '''export_json(permit=None, audit=None, template=None, filterby=None, pretty_print=False)''' |
| 72 | - exporta the requested resources as JSON |
| 73 | |
| 74 | '''import_xml(tree, permit=None, audit=None, onvalidation=None, onaccept=None)''' |
| 75 | - import the requested resources from the given !ElementTree |
| 76 | |
| 77 | '''options_xml(pretty_print=False)''' |
| 78 | - export the options of a field in the resource as XML |
| 79 | |
| 80 | '''options_json(pretty_print=False)''' |
| 81 | - export the options of a field in the resource as JSON |