def _apply(self, value):
if len(value) < self.min_length:
#
# Note that we do not pad the value:
# - It is not clear to which end(s) we should add the
# padding.
# - It is not clear what the padding value(s) should be.
# - We should keep this filter's behavior consistent with
# that of MaxLength.
#
return self._invalid_value(
value = value,
reason = self.CODE_TOO_SHORT,
template_vars = {
'length': len(value),
'min': self.min_length,
},
)
return value
评论列表
文章目录