Comment 0 for bug 583502

Revision history for this message
Abel Deuring (adeuring) wrote :

Running this script:

from zope.schema.vocabulary import getVocabularyRegistry
from lp.registry.interfaces.person import IPersonSet

vocabulary_registry = getVocabularyRegistry()
team = getUtility(IPersonSet).getByName('hwdb-team')
team_vocab = vocabulary_registry.get(team, 'ValidTeamMember')
print len(team_vocab)
print team.activemembers.count()

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.