コード例 #1
0
 def tile_item_image_scale(self):
     # read and return from context settings if behavior applied
     if IProductTilesViewSettingsBehavior.providedBy(self.context):
         return self.context.product_tiles_view_image_scale
     # read and return from productshop settings
     registry = getUtility(IRegistry)
     settings = registry.forInterface(IProductShopSettings)
     return settings.product_tiles_view_image_scale
コード例 #2
0
ファイル: views.py プロジェクト: Gomez/bda.plone.productshop
 def tile_item_image_scale(self):
     # read and return from context settings if behavior applied
     if IProductTilesViewSettingsBehavior.providedBy(self.context):
         return self.context.product_tiles_view_image_scale
     # read and return from productshop settings
     registry = getUtility(IRegistry)
     settings = registry.forInterface(IProductShopSettings)
     return settings.product_tiles_view_image_scale
コード例 #3
0
 def tile_columns(self):
     # read and return from context settings if behavior applied
     if IProductTilesViewSettingsBehavior.providedBy(self.context):
         tile_columns = self.context.product_tiles_view_columns
         if tile_columns and tile_columns > 0:
             return tile_columns
     tile_columns = self.settings.product_tiles_view_columns
     if tile_columns and tile_columns > 0:
         return tile_columns
     # fallback
     return FALLBACK_TILE_COLUMNS
コード例 #4
0
 def tile_columns(self):
     # read and return from context settings if behavior applied
     if IProductTilesViewSettingsBehavior.providedBy(self.context):
         tile_columns = self.context.product_tiles_view_columns
         if tile_columns and tile_columns > 0:
             return tile_columns
     # read and return from productshop settings
     registry = getUtility(IRegistry)
     settings = registry.forInterface(IProductShopSettings)
     tile_columns = settings.product_tiles_view_columns
     if tile_columns and tile_columns > 0:
         return tile_columns
     # fallback
     return FALLBACK_TILE_COLUMNS
コード例 #5
0
ファイル: views.py プロジェクト: Gomez/bda.plone.productshop
 def tile_columns(self):
     # read and return from context settings if behavior applied
     if IProductTilesViewSettingsBehavior.providedBy(self.context):
         tile_columns = self.context.product_tiles_view_columns
         if tile_columns and tile_columns > 0:
             return tile_columns
     # read and return from productshop settings
     registry = getUtility(IRegistry)
     settings = registry.forInterface(IProductShopSettings)
     tile_columns = settings.product_tiles_view_columns
     if tile_columns and tile_columns > 0:
         return tile_columns
     # fallback
     return FALLBACK_TILE_COLUMNS
コード例 #6
0
 def tile_item_image_scale(self):
     # read and return from context settings if behavior applied
     if IProductTilesViewSettingsBehavior.providedBy(self.context):
         return self.context.product_tiles_view_image_scale
     return self.settings.product_tiles_view_image_scale