if kwargs['district']:
            query = query.filter(models.CandidateHistory.district == kwargs['district'])