members_from_vocab = [term.value for term in team_vocab]
real_members = [person for person in members_from_vocab
if person.inTeam(team)]
unreal_members = [person for person in members_from_vocab
if not person.inTeam(team)]
print len(real_members)
print len(unreal_members)
in bin/iharness gives this output:
116
17
18
98
__iter__() returns every record of the table Person, and __len__() returns the number of these records. It seems that the class attribute _filter is missing.
Running this script:
from zope.schema. vocabulary import getVocabularyRe gistry interfaces. person import IPersonSet
from lp.registry.
vocabulary_registry = getVocabularyRe gistry( ) IPersonSet) .getByName( 'hwdb-team' ) registry. get(team, 'ValidTeamMember') ers.count( )
team = getUtility(
team_vocab = vocabulary_
print len(team_vocab)
print team.activememb
members_from_vocab = [term.value for term in team_vocab]
real_members = [person for person in members_from_vocab inTeam( team)] inTeam( team)]
if person.
unreal_members = [person for person in members_from_vocab
if not person.
print len(real_members)
print len(unreal_members)
in bin/iharness gives this output:
116
17
18
98
__iter__() returns every record of the table Person, and __len__() returns the number of these records. It seems that the class attribute _filter is missing.