Changes between Version 24 and Version 25 of BluePrintREST
- Timestamp:
- 01/01/09 02:26:55 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BluePrintREST
v24 v25 20 20 We can easily change to URLs like these (see [wiki:BluePrintRESTImplementation BluePrintRESTImplementation]): 21 21 {{{ 22 /sahana/gis/feature # Acts as 'list' 22 /sahana/gis/feature # Acts as 'list' (or list_add if t2.logged_in) 23 23 /sahana/gis/feature/id # Acts as 'display' 24 24 /sahana/gis/feature/create 25 /sahana/gis/feature/list26 /sahana/gis/feature/list_add27 25 /sahana/gis/feature/display/id 28 26 /sahana/gis/feature/update/id 29 27 /sahana/gis/feature/delete/id 30 28 }}} 31 or these:29 or potentially these: 32 30 {{{ 33 31 /sahana/gis/feature/id?method=display … … 38 36 39 37 There are benefits: 38 * Consistency & ease of implementation of all basic functionality for new tables. 40 39 * Simplified ability to create .represent widgets: 41 40 {{{ 42 def shn_list_item(table, action,display='table.name',extra=None):41 def shn_list_item(table,resource,action,display='table.name',extra=None): 43 42 if extra: 44 items=DIV(TR(TD(A(eval(display),_href=t2.action( action,table.id))),TD(eval(extra))))43 items=DIV(TR(TD(A(eval(display),_href=t2.action(resource,[action,table.id]))),TD(eval(extra)))) 45 44 else: 46 items=DIV(A(eval(display),_href=t2.action( action,table.id)))45 items=DIV(A(eval(display),_href=t2.action(resource,[action,table.id]))) 47 46 return DIV(*items) 48 47 }}}