def clean_fields(self, *args, **kwargs): # Note that this isn't run during updates, alas. if any([self.votes_yes, self.votes_no]) and not \ all([self.votes_yes, self.votes_no]): return ValidationError("votes_yes and votes_no must both be either " "empty or completed.") for field in ['start', 'termination']: validate_partial_date(self, field) super(Position, self).clean_fields(*args, **kwargs)
def clean_fields(self, *args, **kwargs): validate_partial_date(self, ['start', 'termination']) validate_is_not_alias(self, ['person', 'supervisor', 'predecessor', 'school']) validate_at_most_n(self, 1, ['school', 'organization_name', 'court']) validate_exactly_n(self, 1, ['position_type', 'job_title']) validate_all_or_none(self, ['votes_yes', 'votes_no']) validate_all_or_none(self, ['votes_yes_percent', 'votes_no_percent']) validate_not_all(self, ['votes_yes', 'votes_no', 'votes_yes_percent', 'votes_no_percent']) validate_nomination_fields_ok(self) validate_supervisor(self) super(Position, self).clean_fields(*args, **kwargs)
def clean_fields(self, *args, **kwargs): validate_partial_date(self, ['dob', 'dod']) validate_is_not_alias(self, ['is_alias_of']) validate_has_full_name(self) super(Person, self).clean_fields(*args, **kwargs)
def clean_fields(self, *args, **kwargs): validate_partial_date(self, ['start', 'end']) validate_is_not_alias(self, ['person']) super(PoliticalAffiliation, self).clean_fields(*args, **kwargs)
def clean_fields(self, *args, **kwargs): validate_partial_date(self, 'rated') super(ABARating, self).clean_fields(*args, **kwargs)
def clean_fields(self, *args, **kwargs): for field in ['start', 'end']: validate_partial_date(self, field) super(PoliticalAffiliation, self).clean_fields(*args, **kwargs)
def clean_fields(self, *args, **kwargs): for field in ['dob', 'dod']: validate_partial_date(self, field) super(Person, self).clean_fields(*args, **kwargs)