Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

git-svn-id: https://svn.bluedynamics.eu/svn/module/bda.bfg.tile/trunk…

…@1810 f119a143-da5b-4457-81e3-bee00661a780
  • Loading branch information...
commit bd23b89e383d9e634ca72b0835da07dea1f201bf 1 parent 3fca920
rnix authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 src/bda/bfg/tile/_api.py
View
13 src/bda/bfg/tile/_api.py
@@ -25,7 +25,11 @@
from repoze.bfg.chameleon_zpt import ZPTTemplateRenderer
class ITile(Interface):
- """Renders some HTML snippet."""
+ """Renders some HTML snippet.
+ """
+
+ name = Attribute(u"The name und which this tile is registered.")
+ show = Attribute(u"Flag wether to render the tile.")
def __call__(model, request):
"""Renders the tile.
@@ -40,8 +44,6 @@ def prepare():
I.e. fetch data to display ...
"""
-
- show = Attribute("""Render this tile?""")
def _update_kw(**kw):
if not ('request' in kw and 'model' in kw):
@@ -112,7 +114,8 @@ def __call__(self, name):
class Tile(object):
implements(ITile)
- def __init__(self, path, attribute):
+ def __init__(self, path, attribute, name):
+ self.name = name
self.path = path
self.attribute = attribute
@@ -216,7 +219,7 @@ def registerTile(name, path=None, attribute='render',
"""
if path and not (':' in path or os.path.isabs(path)):
path = '%s:%s' % (caller_package(_level).__name__, path)
- tile = _class(path, attribute)
+ tile = _class(path, attribute, name)
registry = get_current_registry()
if permission is not None:
authn_policy = registry.queryUtility(IAuthenticationPolicy)
Please sign in to comment.
Something went wrong with that request. Please try again.