~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-06-10 19:18:44 UTC
  • mfrom: (13175.2.3 bug-735991)
  • Revision ID: launchpad@pqm.canonical.com-20110610191844-wo6ryjj31ooqr3aa
[r=bac][bug=735991] more efficient implementation of
        Person.getBugSubscriberPackages();
        call canonical_url(self.context) exactly once when ~person/+packagebugs
        is rendered.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2005
2005
 
2006
2006
        return package_links
2007
2007
 
 
2008
    @cachedproperty
 
2009
    def person_url(self):
 
2010
        return canonical_url(self.context)
 
2011
 
2008
2012
    def getBugSubscriberPackageSearchURL(self, distributionsourcepackage=None,
2009
2013
                                      advanced=False, extra_params=None):
2010
2014
        """Construct a default search URL for a distributionsourcepackage.
2029
2033
 
2030
2034
            params.update(extra_params)
2031
2035
 
2032
 
        person_url = canonical_url(self.context)
2033
2036
        query_string = urllib.urlencode(sorted(params.items()), doseq=True)
2034
2037
 
2035
2038
        if advanced:
2036
 
            return (person_url + '/+packagebugs-search?advanced=1&%s'
 
2039
            return (self.person_url + '/+packagebugs-search?advanced=1&%s'
2037
2040
                    % query_string)
2038
2041
        else:
2039
 
            return person_url + '/+packagebugs-search?%s' % query_string
 
2042
            return self.person_url + '/+packagebugs-search?%s' % query_string
2040
2043
 
2041
2044
    def getBugSubscriberPackageAdvancedSearchURL(self,
2042
2045
                                              distributionsourcepackage=None):