def s3_rheader_resource(r):
 _vars = r.get_vars
 if ('viewing' in _vars):
  try:
   (tablename, record_id) = _vars.viewing.rsplit('.', 1)
   db = current.db
   record = db[tablename][record_id]
  except:
   tablename = r.tablename
   record = r.record
 else:
  tablename = r.tablename
  record = r.record
 return (tablename, record)

def s3_rheader_resource ( r ) : _vars = r . get_vars if ( 'viewing' in _vars ) : try : ( tablename , record_id ) = _vars . viewing . rsplit ( '.' , 1 ) db = current . db record = db [ tablename ] [ record_id ] except : tablename = r . tablename record = r . record else : tablename = r . tablename record = r . record return ( tablename , record )
identify the tablename and record id for the rheader .