Allow validation functions to rewrite the value.  If a validation function
returns a value, the new value will be stored in the document's metadata.
This allows certain metadata types to be normalized (dates, for example).
For example, the date validation function could validate the input,
convert it to a "datetime" and then return "datetime.date().isoformat()".
Sample code:
def is_valid_date(value):
  from dateutil import parser
  import datetime
  from django.core.exceptions import ValidationError

  try:
    dt = parser.parse(value)
  except ValueError:
    raise ValidationError('Invalid date')
  return dt.date().isoformat()

This validator will validate the the user entered a valid date and will
normalize the date to isoformat, making indexing easier.