def _is_proposal_creation_finished(proposal_version): proposal_item = find_interface(proposal_version, IProposal) versions_with_data = [ x for x in proposal_item.values() if IProposalVersion.providedBy(x) and has_annotation_sheet_data(x) ] return len(versions_with_data) == 1
def _is_bplan_and_has_no_version_with_sheet_data(self, meta: ResourceMetadata, context: IPool) -> bool: is_bplan_version = meta.iresource.isOrExtends(IProposalVersion) if not is_bplan_version: return False versions_with_data = [x for x in context.values() if IProposalVersion.providedBy(x) and has_annotation_sheet_data(x)] return versions_with_data == []
def _is_bplan_and_has_no_version_with_sheet_data(self, meta: ResourceMetadata, context: IPool) -> bool: is_bplan_version = meta.iresource.isOrExtends(IProposalVersion) if not is_bplan_version: return False versions_with_data = [ x for x in context.values() if IProposalVersion.providedBy(x) and has_annotation_sheet_data(x) ] return versions_with_data == []
def _is_proposal_creation_finished(proposal_version): proposal_item = find_interface(proposal_version, IProposal) versions_with_data = [x for x in proposal_item.values() if IProposalVersion.providedBy(x) and has_annotation_sheet_data(x)] return len(versions_with_data) == 1
def _is_proposal_creation_finished(proposal_version): proposal_item = find_interface(proposal_version, IProposal) return len([ version for version in proposal_item.values() if IProposalVersion.providedBy(version) ]) == 2
def _is_proposal_creation_finished(proposal_version): proposal_item = find_interface(proposal_version, IProposal) return len([version for version in proposal_item.values() if IProposalVersion.providedBy(version)]) == 2