~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/interfaces/person.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-08-17 07:03:25 UTC
  • mfrom: (11307.2.20 registry)
  • Revision ID: launchpad@pqm.canonical.com-20100817070325-paezn3lnovq782re
[r=henninge, sinzui][ui=none][bug=615237] Reduce the query count for
        team/participants to 11 from hundreds for ubuntu-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1231
1231
    all_member_count = Attribute(
1232
1232
        "The total number of real people who are members of this team, "
1233
1233
        "including subteams.")
1234
 
    allmembers = exported(
 
1234
    all_members_prepopulated = exported(
1235
1235
        doNotSnapshot(
1236
1236
            CollectionField(
1237
1237
                title=_("All participants of this team."),
1243
1243
                    "IPerson.inTeam()."),
1244
1244
                value_type=Reference(schema=Interface))),
1245
1245
        exported_as='participants')
 
1246
    allmembers = doNotSnapshot(
 
1247
        Attribute("List of all members, without checking karma etc."))
1246
1248
    approvedmembers = doNotSnapshot(
1247
1249
        Attribute("List of members with APPROVED status"))
1248
1250
    deactivated_member_count = Attribute("Number of deactivated members")
1322
1324
            center_lat, and center_lng
1323
1325
        """
1324
1326
 
1325
 
    def getMembersWithPreferredEmails(include_teams=False):
 
1327
    def getMembersWithPreferredEmails():
1326
1328
        """Returns a result set of persons with precached addresses.
1327
1329
 
1328
1330
        Persons or teams without preferred email addresses are not included.
1329
1331
        """
1330
1332
 
1331
 
    def getMembersWithPreferredEmailsCount(include_teams=False):
1332
 
        """Returns the count of persons/teams with preferred emails."""
 
1333
    def getMembersWithPreferredEmailsCount():
 
1334
        """Returns the count of persons/teams with preferred emails.
 
1335
        
 
1336
        See also getMembersWithPreferredEmails.
 
1337
        """
1333
1338
 
1334
1339
    def getDirectAdministrators():
1335
1340
        """Return this team's administrators.
2123
2128
 
2124
2129
 
2125
2130
# Fix value_type.schema of IPersonViewRestricted attributes.
2126
 
for name in ['allmembers', 'activemembers', 'adminmembers', 'proposedmembers',
2127
 
             'invited_members', 'deactivatedmembers', 'expiredmembers',
2128
 
             'unmapped_participants']:
 
2131
for name in [
 
2132
    'all_members_prepopulated',
 
2133
    'activemembers',
 
2134
    'adminmembers',
 
2135
    'proposedmembers',
 
2136
    'invited_members',
 
2137
    'deactivatedmembers',
 
2138
    'expiredmembers',
 
2139
    'unmapped_participants',
 
2140
    ]:
2129
2141
    IPersonViewRestricted[name].value_type.schema = IPerson
2130
2142
 
2131
2143
IPersonPublic['sub_teams'].value_type.schema = ITeam