45 | | |
46 | | === Custom Methods === |
47 | | |
48 | | You can resource-specific custom methods by: |
49 | | {{{ |
50 | | s3xrc.model.set_method(prefix, name, method, action) |
51 | | }}} |
52 | | |
53 | | where: |
54 | | |
55 | | - '''prefix''' is the module prefix of a resource |
56 | | - '''name''' is the name of the resource (without prefix) |
57 | | - '''method''' is a string representing the name of the method (e.g. "search_simple") |
58 | | - '''action''' is the method handler function/lambda |
59 | | |
60 | | The ''action'' method has to take the same arguments as the default handlers: ''r'' (S3Request) and ''**attr''. |
61 | | |
62 | | This features URLs like: |
63 | | |
64 | | /prefix/name/<record_id>/<method> |