Changes between Version 24 and Version 25 of BluePrintREST


Ignore:
Timestamp:
01/01/09 02:26:55 (13 years ago)
Author:
Fran Boon
Comment:

Update a little for our working implementation

Legend:

Unmodified
Added
Removed
Modified
  • BluePrintREST

    v24 v25  
    2020We can easily change to URLs like these (see [wiki:BluePrintRESTImplementation BluePrintRESTImplementation]):
    2121{{{
    22 /sahana/gis/feature           # Acts as 'list'
     22/sahana/gis/feature           # Acts as 'list' (or list_add if t2.logged_in)
    2323/sahana/gis/feature/id        # Acts as 'display'
    2424/sahana/gis/feature/create
    25 /sahana/gis/feature/list
    26 /sahana/gis/feature/list_add
    2725/sahana/gis/feature/display/id
    2826/sahana/gis/feature/update/id
    2927/sahana/gis/feature/delete/id
    3028}}}
    31 or these:
     29or potentially these:
    3230{{{
    3331/sahana/gis/feature/id?method=display
     
    3836
    3937There are benefits:
     38 * Consistency & ease of implementation of all basic functionality for new tables.
    4039 * Simplified ability to create .represent widgets:
    4140{{{
    42 def shn_list_item(table,action,display='table.name',extra=None):
     41def shn_list_item(table,resource,action,display='table.name',extra=None):
    4342    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))))
    4544    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])))
    4746    return DIV(*items)
    4847}}}