def clean(self, *args, **kwargs): super(CydnsRecord, self).clean(*args, **kwargs) self.check_TLD_condition() check_no_ns_soa_condition(self.domain) self.check_domain_ctnr() self.check_for_delegation() if self.rdtype != 'CNAME': self.check_for_cname()
def clean_views(self, views): """cleaned_data is the data that is going to be called with for updating an existing or creating a new object. Classes should implement this function according to their specific needs. """ for view in views: if hasattr(self, 'domain'): check_no_ns_soa_condition(self.domain, view=view) if hasattr(self, 'reverse_domain'): check_no_ns_soa_condition(self.reverse_domain, view=view)
def clean(self, *args, **kwargs): super(CydnsRecord, self).clean(*args, **kwargs) self.check_TLD_condition() check_no_ns_soa_condition(self.domain) self.check_domain_ctnr() if not (hasattr(self, "is_glue") and self.is_glue is True and self.pk is None): self.check_for_delegation() if self.rdtype != 'CNAME': self.check_for_cname()
def clean(self, *args, **kwargs): super(BasePTR, self).clean(*args, **kwargs) is_new = self.pk is None if is_new: self.set_reverse_domain() else: db_self = self.__class__.objects.get(pk=self.pk) if db_self.ip_str != self.ip_str: self.set_reverse_domain() check_no_ns_soa_condition(self.reverse_domain) self.reverse_validate_no_cname() self.check_ip_conflict()