def add_invalid_vote_category(self, categoryDescription): invalid_vote_category = db.session.query(InvalidVoteCategory).filter( InvalidVoteCategory.Model.electionId == self.electionId, InvalidVoteCategory.Model.categoryDescription == categoryDescription ).one_or_none() if invalid_vote_category is None: invalid_vote_category = InvalidVoteCategory.create( electionId=self.electionId, categoryDescription=categoryDescription ) return invalid_vote_category
def add_invalid_vote_category(self, categoryDescription): return InvalidVoteCategory.create( electionId=self.electionId, categoryDescription=categoryDescription)