2
0

validators.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ==========
  2. Validators
  3. ==========
  4. .. module:: django.contrib.postgres.validators
  5. These validators are available from the ``django.contrib.postgres.validators``
  6. module.
  7. ``KeysValidator``
  8. =================
  9. .. class:: KeysValidator(keys, strict=False, messages=None)
  10. Validates that the given keys are contained in the value. If ``strict`` is
  11. ``True``, then it also checks that there are no other keys present.
  12. The ``messages`` passed should be a dict containing the keys
  13. ``missing_keys`` and/or ``extra_keys``.
  14. .. note::
  15. Note that this checks only for the existence of a given key, not that
  16. the value of a key is non-empty.
  17. Range validators
  18. ================
  19. ``RangeMaxValueValidator``
  20. --------------------------
  21. .. class:: RangeMaxValueValidator(limit_value, message=None)
  22. Validates that the upper bound of the range is not greater than
  23. ``limit_value``.
  24. ``RangeMinValueValidator``
  25. --------------------------
  26. .. class:: RangeMinValueValidator(limit_value, message=None)
  27. Validates that the lower bound of the range is not less than the
  28. ``limit_value``.