def _get_validation_exclusions(obj, pk=None, slug_field=None, lookup_field=None):
 include = []
 if pk:
  pk_field = obj._meta.pk
  while pk_field.rel:
   pk_field = pk_field.rel.to._meta.pk
  include.append(pk_field.name)
 if slug_field:
  include.append(slug_field)
 if (lookup_field and (lookup_field != 'pk')):
  include.append(lookup_field)
 return [field.name for field in obj._meta.fields if (field.name not in include)]

def _get_validation_exclusions ( obj , pk = None , slug_field = None , lookup_field = None ) : include = [ ] if pk : pk_field = obj . _meta . pk while pk_field . rel : pk_field = pk_field . rel . to . _meta . pk include . append ( pk_field . name ) if slug_field : include . append ( slug_field ) if ( lookup_field and ( lookup_field != 'pk' ) ) : include . append ( lookup_field ) return [ field . name for field in obj . _meta . fields if ( field . name not in include ) ]
given a model instance .