=== modified file 'controllers/rms.py' --- controllers/rms.py 2010-01-26 07:42:02 +0000 +++ controllers/rms.py 2010-01-28 03:42:59 +0000 @@ -17,15 +17,19 @@ # S3 framework functions def index(): - "Module's Home Page" - return dict(module_name=module_name, a=1) - -def test(): - "Module's Home Page" - return dict(module_name=module_name, a=1) - -def req(): #aid requests - "RESTlike CRUD controller" + """ + As the default controller, index displays module's home page. + """ + return dict(module_name=module_name, a=1) + +def req(): + """ + The req function allows users to search the database for + aid requsts as a 'RESTlike CRUD controller'. + + If the function is invoked without arguments, the function + defaults to a simple search. + """ resource = 'req' # pulls from table of combined aid request feeds (sms, tweets, manual) @@ -43,8 +47,13 @@ # return shn_rest_controller(module, resource, editable=False, listadd=False) -def req_detail(): #arbitrary key:value pairs for aid requests - "RESTlike CRUD controller" +def req_detail(): + """ + req_detail allows users to access the detail of + a particular request for assistance. + + Note: arbitrary key:value pairs are used for aid requests + """ resource = 'req_detail' #an optional unconnected list of all the arbitrary key-values for requests @@ -54,7 +63,14 @@ return shn_rest_controller( module , resource, editable=False, listadd=False) -def pledge(): #pledges from agencies +def pledge(): + """ + Allows users (hopefully from effective agencies) to + pledge assistance to those people who have made requests. + + """ + + #pledges from agencies "RESTlike CRUD controller" resource = 'pledge' @@ -71,7 +87,10 @@ return shn_rest_controller(module, resource, editable = True, listadd=False) -def shn_rms_req_pheader(resource, record_id, representation, next=None, same=None): #parent header for child/parent forms +def shn_rms_req_pheader(resource, record_id, representation, next=None, same=None): + """ + Parent header for child/parent forms + """ if representation == "html": if next: @@ -127,7 +146,14 @@ else: return None -def sms_complete(): #contributes to RSS feed for closing the loop with Ushahidi +def sms_complete(): + """ + sms_complete contributes to the RSS feed by closing the loop with Ushahidi. + + It provides an RSS feed with the title (t) & both Sahana's id & + Ushahidi's (d). + + """ def t(record): return "Sahana Record Number: " + str(record.id) @@ -145,7 +171,14 @@ return shn_rest_controller(module, 'req', editable=False, listadd=False, rss=rss) -def tweet_complete(): #contributes to RSS feed for closing the loop with TtT +def tweet_complete(): + """ + tweet_complete contributes to the RSS feed by closing the loop with Tweak the Tweet. + + It provides an RSS feed with the title (t) & both Sahana's id & + Ushahidi's (d). + + """ def t(record): return "Sahana Record Number: " + str(record.id)