• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 33. Writing New ZCML Directives > Step 1: Developing the Directive Sche...

Step 1: Developing the Directive Schema

In a new file named metadirectives.py, you need to add the following schema:

01 from zope.interface import Interface
02 from zope.configuration.fields import GlobalObject
03 from zope.schema import TextLine
04
05 class IRedirectDirective(Interface):
06    """Redirects clients to a specified URL."""
07
08    name = TextLine(
09        title=u"Name",
10        description=u"The name of the requested view.")
11
12    for_ = GlobalObject(
13        title=u"For Interface",
14        description=u"The interface the directive is used for.",
15        required=False)
16
17    url = TextLine(
18        title=u"URL",
19        description=u"The URL the client should be redirected to.")
20
21    layer = TextLine(
22        title=u"Layer",
23        description=u"The layer the redirect is defined in.",
24        required=False)


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint