def _get_pks_model_and_ctype(objects):
 if isinstance(objects, QuerySet):
  model = objects.model
  pks = [force_text(pk) for pk in objects.values_list(u'pk', flat=True)]
  ctype = get_content_type(model)
 else:
  pks = []
  for (idx, obj) in enumerate(objects):
   if (not idx):
    model = type(obj)
    ctype = get_content_type(model)
   pks.append(force_text(obj.pk))
 return (pks, model, ctype)

def _get_pks_model_and_ctype ( objects ) : if isinstance ( objects , QuerySet ) : model = objects . model pks = [ force_text ( pk ) for pk in objects . values_list ( u'pk' , flat = True ) ] ctype = get_content_type ( model ) else : pks = [ ] for ( idx , obj ) in enumerate ( objects ) : if ( not idx ) : model = type ( obj ) ctype = get_content_type ( model ) pks . append ( force_text ( obj . pk ) ) return ( pks , model , ctype )
returns the primary keys .