def organisation_needs():
 def prep(r):
  if r.interactive:
   if (r.method == 'create'):
    organisation_id = get_vars.get('~.(organisation)', None)
    if organisation_id:
     field = s3db.req_organisation_needs.organisation_id
     field.default = organisation_id
     field.readable = False
     field.writable = False
   elif (r.method == 'update'):
    field = s3db.req_organisation_needs.organisation_id
    field.writable = False
    field.comment = None
  return True
 s3.prep = prep
 return s3_rest_controller()

def organisation_needs ( ) : def prep ( r ) : if r . interactive : if ( r . method == 'create' ) : organisation_id = get_vars . get ( '~.(organisation)' , None ) if organisation_id : field = s3db . req_organisation_needs . organisation_id field . default = organisation_id field . readable = False field . writable = False elif ( r . method == 'update' ) : field = s3db . req_organisation_needs . organisation_id field . writable = False field . comment = None return True s3 . prep = prep return s3_rest_controller ( )
restful crud controller for organisation needs .