code: def get_db_distinct(queryset, field, func, **params):
      
      while True:
          try:
              value = func(**params)
              queryset.get(**{field: value})
          except ObjectDoesNotExist:
              break
      return value
docs: Checks if a field / value pair exists in database
      and continues generating values until it finds
      a one that does not exist
  
      func is the function that generates values and
      params is the parameters that function takes