Changeset 1831 in products


Ignore:
Timestamp:
Feb 25, 2010 3:17:37 PM (14 years ago)
Author:
mylan
Message:

#142: Minimize calculations for seo_context view: Remove 'seo_globalWithoutLocalCustomMetaTags' from the _seotags dictionary - need only for SEO tags edit form; use memoized plone_context_state.object_title values as default Title for the object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/browser/views.py

    r1827 r1831  
    2828    def __init__(self, *args, **kwargs): 
    2929        super(SEOContext, self).__init__(*args, **kwargs) 
    30         self.pcs = queryMultiAdapter((self.context, self.request), name="plone_portal_state") 
    31         self.gseo = queryAdapter(self.pcs.portal(), ISEOConfigletSchema) 
     30        self.pps = queryMultiAdapter((self.context, self.request), name="plone_portal_state") 
     31        self.pcs = queryMultiAdapter((self.context, self.request), name="plone_context_state") 
     32        self.gseo = queryAdapter(self.pps.portal(), ISEOConfigletSchema) 
    3233        self._seotags = self._getSEOTags() 
    3334 
     
    3839    def _getSEOTags(self): 
    3940        seotags = { 
    40             "seo_title": self.getSEOProperty( 'qSEO_title', accessor='Title' ), 
     41            "seo_title": self.getSEOProperty( 'qSEO_title', default=self.pcs.object_title() ), 
    4142            "seo_robots": self.getSEOProperty( 'qSEO_robots', default='ALL'), 
    4243            "seo_description": self.getSEOProperty( 'qSEO_description', accessor='Description' ), 
    4344            "seo_distribution": self.getSEOProperty( 'qSEO_distribution', default="Global"), 
    4445            "seo_customMetaTags": self.seo_customMetaTags(), 
    45             "seo_globalWithoutLocalCustomMetaTags": self.seo_globalWithoutLocalCustomMetaTags(), 
    4646            "seo_localCustomMetaTags": self.seo_localCustomMetaTags(), 
    4747            "seo_globalCustomMetaTags": self.seo_globalCustomMetaTags(), 
     
    134134        """ 
    135135        canpath = queryAdapter(self.context, interfaces.ISEOCanonicalPath) 
    136         return self.pcs.portal_url() + canpath.canonical_path() 
     136        return self.pps.portal_url() + canpath.canonical_path() 
    137137 
    138138 
Note: See TracChangeset for help on using the changeset viewer.