Example #1
0
    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)
Example #2
0
    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)
Example #3
0
 def clean_fields(self, *args, **kwargs):
     # An alias cannot be an alias.
     validate_is_not_alias(self, ['is_alias_of'])
     super(School, self).clean_fields(*args, **kwargs)
Example #4
0
 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)
Example #5
0
 def clean_fields(self, *args, **kwargs):
     validate_is_not_alias(self, ['person'])
     super(ABARating, self).clean_fields(*args, **kwargs)
Example #6
0
 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)
Example #7
0
 def clean_fields(self, *args, **kwargs):
     # Note that this isn't run during updates, alas.
     validate_is_not_alias(self, ['person', 'school'])
     super(Education, self).clean_fields(*args, **kwargs)
Example #8
0
 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)
Example #9
0
 def clean_fields(self, *args, **kwargs):
     # Note that this isn't run during updates, alas.
     validate_is_not_alias(self, ['person', 'school'])
     super(Education, self).clean_fields(*args, **kwargs)
Example #10
0
 def clean_fields(self, *args, **kwargs):
     # An alias cannot be an alias.
     validate_is_not_alias(self, ['is_alias_of'])
     super(School, self).clean_fields(*args, **kwargs)
Example #11
0
 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)
Example #12
0
 def clean_fields(self, *args, **kwargs):
     validate_is_not_alias(self, ['person'])
     super(ABARating, self).clean_fields(*args, **kwargs)