Changes between Version 74 and Version 75 of RESTController
- Timestamp:
- 03/05/13 09:26:41 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RESTController
v74 v75 70 70 * Multiple record select: http://localhost:8000/eden/pr/person?person.uid=12345678-9012-3456-7890,65434567-8901-2345-67890123 71 71 * Filter by characteristic: http://localhost:8000/eden/pr/person?person.gender=male 72 72 73 == Model == 73 74 74 Example for definition of a component table in the model: 75 75 … … 152 152 if len(request.args) == 2: 153 153 crud.settings.update_next = URL(f="kit_item", args=request.args[1]) 154 return s hn_rest_controller(module, "kit", main="code", onaccept=lambda form: kit_total(form))154 return s3_rest_controller(module, "kit", main="code", onaccept=lambda form: kit_total(form)) 155 155 }}} 156 156 … … 179 179 {{{ 180 180 # Plug into REST controller 181 s3 mgr.model.set_method(module, "person", method="search_simple", action=shn_pr_person_search_simple )181 s3db.set_method(module, "person", method="search_simple", action=shn_pr_person_search_simple ) 182 182 }}} 183 183 … … 195 195 person = db(db.pr_person.uuid == auth.user.person_uuid).select(db.pr_person.id) 196 196 response.s3.filter = (db.msg_inbox.person_id == person[0].id) 197 s3 mgr.model.set_method(module, "inbox", method="create", action = restricted_method)197 s3db.set_method(module, "inbox", method="create", action = restricted_method) 198 198 return s3_rest_controller(module, "inbox", listadd=False, editable = False) 199 199 … … 211 211 212 212 * '''r''' = an instance of ''S3RESTRequest'' containing all data about the request 213 * '''**attr''' = a dictionary of named arguments (same named args as passed to the s hn_rest_controller)213 * '''**attr''' = a dictionary of named arguments (same named args as passed to the s3_rest_controller) 214 214 215 215 ----