docs: def validate_model_unique(lookup_field, queryset, pk_field=None, pk_value=None):
      """
      Validate the field is a unique, given a queryset and lookup_field. Example::
  
          validator = validate_model_unique(User.email, User.select())
  
      Creates a validator that can validate the uniqueness of an email address.
  
      :param lookup_field: Peewee model field that should be used for checking existing values.
      :param queryset: Queryset to use for lookup.
      :param pk_field: Field instance to use when excluding existing instance.
      :param pk_value: Field value to use when excluding existing instance.
      :raises: ``ValidationError('unique')``
      """
      def unique_validator(field, data):
          # If we have a PK, ignore it because it represents the current record.
          query = queryset.where(lookup_field == field.value)
          if pk_field and pk_value:
              query = query.where(~(pk_field == pk_value))
          if query.count():
              raise ValidationError('unique')
      return unique_validator