Changeset 1900 in products for quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/browser/views.py
- Timestamp:
- Mar 12, 2010 2:08:40 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/browser/views.py
r1831 r1900 120 120 """ 121 121 result = [] 122 context = aq_inner(self.context)123 122 if self.gseo: 124 custom_meta_tags = self.gseo.default_custom_metatags 125 for tag in custom_meta_tags: 123 for tag in self.gseo.default_custom_metatags: 126 124 name_value = tag.split(SEPERATOR) 127 125 if name_value[0]: … … 141 139 """ 142 140 template = ViewPageTemplateFile('templates/seo_context_properties.pt') 141 142 def __init__(self, *args, **kwargs): 143 super(SEOContextPropertiesView, self).__init__(*args, **kwargs) 144 self.pps = queryMultiAdapter((self.context, self.request), 145 name="plone_portal_state") 146 self.gseo = queryAdapter(self.pps.portal(), ISEOConfigletSchema) 147 143 148 144 149 def test( self, condition, first, second ): … … 231 236 """ Update seo custom metatags properties. 232 237 """ 233 context = aq_inner(self.context)234 site_properties = getToolByName(context, 'portal_properties')235 238 globalCustomMetaTags = [] 236 if hasattr(site_properties, 'seo_properties'):237 custom_meta_tags = getattr(site_properties.seo_properties, 'default_custom_metatags', [])239 if self.gseo: 240 custom_meta_tags = self.gseo.default_custom_metatags 238 241 for tag in custom_meta_tags: 239 242 name_value = tag.split(SEPERATOR) 240 243 if name_value[0]: 241 globalCustomMetaTags.append({'meta_name' : name_value[0], 242 'meta_content' : len(name_value) == 1 and '' or name_value[1]}) 244 globalCustomMetaTags.append( 245 {'meta_name' : name_value[0], 246 'meta_content' : len(name_value) == 1 and '' or name_value[1]}) 243 247 for tag in custommetatags: 244 248 meta_name, meta_content = tag['meta_name'], tag['meta_content'] 245 249 if meta_name: 246 if not [gmt for gmt in globalCustomMetaTags if (gmt['meta_name']==meta_name and gmt['meta_content']==meta_content)]: 250 if not [gmt for gmt in globalCustomMetaTags \ 251 if (gmt['meta_name']==meta_name and gmt['meta_content']==meta_content)]: 247 252 self.setProperty('%s%s' % (PROP_CUSTOM_PREFIX, meta_name), meta_content) 248 253
Note: See TracChangeset
for help on using the changeset viewer.