def asset_get_current_log(asset_id):
 table = current.s3db.asset_log
 query = (((table.asset_id == asset_id) & (table.cancel == False)) & (table.deleted == False))
 asset_log = current.db(query).select(table.id, table.status, table.datetime, table.cond, table.person_id, table.organisation_id, table.site_id, orderby=(~ table.datetime), limitby=(0, 1)).first()
 if asset_log:
  return Storage(datetime=asset_log.datetime, person_id=asset_log.person_id, cond=int((asset_log.cond or 0)), status=int((asset_log.status or 0)), organisation_id=asset_log.organisation_id, site_id=asset_log.site_id)
 else:
  return Storage()

def asset_get_current_log ( asset_id ) : table = current . s3db . asset_log query = ( ( ( table . asset_id == asset_id ) & ( table . cancel == False ) ) & ( table . deleted == False ) ) asset_log = current . db ( query ) . select ( table . id , table . status , table . datetime , table . cond , table . person_id , table . organisation_id , table . site_id , orderby = ( ~ table . datetime ) , limitby = ( 0 , 1 ) ) . first ( ) if asset_log : return Storage ( datetime = asset_log . datetime , person_id = asset_log . person_id , cond = int ( ( asset_log . cond or 0 ) ) , status = int ( ( asset_log . status or 0 ) ) , organisation_id = asset_log . organisation_id , site_id = asset_log . site_id ) else : return Storage ( )
get the current log entry for this asset .