Пример #1
0
 def clean(self, value, *args, **kwargs):
     super(HostnameField, self).clean(value, *args, **kwargs)
     if value:
         utils.validate_dns_name(value, hostname=True, error_text=self.error_text)
     return value
Пример #2
0
 def clean(self, value, *args, **kwargs):
     value = super(NameField, self).clean(value, *args, **kwargs)
     if value:
         utils.validate_dns_name(value, self.hostname)
     return value