{% extends "admin/change_form.html" %} {% load static %} {% block after_field_sets %} {{ block.super }} {% if original %}
How to configure validators:
Enter the validator parameters in JSON format in the "Validator params" field. Here are examples for each validator type:
| Validator Type | Description | JSON Parameters Example |
|---|---|---|
MinValueValidator |
Validates that the value is greater than or equal to a minimum | {"limit_value": 10} |
MaxValueValidator |
Validates that the value is less than or equal to a maximum | {"limit_value": 100} |
MinLengthValidator |
Validates that the string length is at least a minimum | {"limit_value": 5} |
MaxLengthValidator |
Validates that the string length does not exceed a maximum | {"limit_value": 255} |
RegexValidator |
Validates that the value matches a regular expression pattern | {"regex": "^[A-Z][0-9]{3}$", "message": "..."} |
EmailValidator |
Validates email address format | {} (no parameters needed) |
URLValidator |
Validates URL format | {} or {"schemes": ["http", "https"]} |
validate_slug |
Validates slug format (letters, numbers, hyphens, underscores) | {} (no parameters needed) |
validate_ipv4_address |
Validates IPv4 address format | {} (no parameters needed) |
validate_ipv6_address |
Validates IPv6 address format | {} (no parameters needed) |
FileExtensionValidator |
Validates file extensions in file paths | {"allowed_extensions": ["jpg", "png", "pdf"]} |