def unpack_dbobj(item):
 _init_globals()
 try:
  obj = (item[3] and _TO_MODEL_MAP[item[1]].objects.get(id=item[3]))
 except ObjectDoesNotExist:
  return None
 except TypeError:
  if hasattr(item, 'pk'):
   return item
  return None
 return (((_TO_DATESTRING(obj) == item[2]) and obj) or None)

def unpack_dbobj ( item ) : _init_globals ( ) try : obj = ( item [ 3 ] and _TO_MODEL_MAP [ item [ 1 ] ] . objects . get ( id = item [ 3 ] ) ) except ObjectDoesNotExist : return None except TypeError : if hasattr ( item , 'pk' ) : return item return None return ( ( ( _TO_DATESTRING ( obj ) == item [ 2 ] ) and obj ) or None )
check and convert internal representations back to django database models .