Example #1
0
def required_slug(field, values):
    value = values.get(field)
    if isinstance(value, str):
        return slugify(value)
    raise exceptions.MissingRequiredFieldXmlParseException(field)
Example #2
0
def required_int(field, values):
    value = values.get(field)
    if isinstance(value, int):
        return value
    raise exceptions.MissingRequiredFieldXmlParseException(field)