def org_organisation_address(row):
 if hasattr(row, 'org_organisation'):
  row = row.org_organisation
 try:
  organisation_id = row.id
 except:
  return current.messages['NONE']
 db = current.db
 s3db = current.s3db
 otable = s3db.org_office
 gtable = s3db.gis_location
 query = (((otable.deleted != True) & (otable.organisation_id == organisation_id)) & (otable.location_id == gtable.id))
 row = db(query).select(gtable.addr_street, limitby=(0, 1)).first()
 if row:
  row.addr_street
 else:
  return current.messages['NONE']

def org_organisation_address ( row ) : if hasattr ( row , 'org_organisation' ) : row = row . org_organisation try : organisation_id = row . id except : return current . messages [ 'NONE' ] db = current . db s3db = current . s3db otable = s3db . org_office gtable = s3db . gis_location query = ( ( ( otable . deleted != True ) & ( otable . organisation_id == organisation_id ) ) & ( otable . location_id == gtable . id ) ) row = db ( query ) . select ( gtable . addr_street , limitby = ( 0 , 1 ) ) . first ( ) if row : row . addr_street else : return current . messages [ 'NONE' ]
the address of the first office .