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

Chapter 34. Implementing TALES Namespace... > Step 1: Defining the Namespace Inter...

Step 1: Defining the Namespace Interface

You need to start out by defining the interface of the namespace you'll be creating. Here's how it should look:

01 from zope.interface import Interface
02
03 class IFormatTalesAPI(Interface):
04
05     def fullDate(self):
06         """Returns the full date using the user's locale.
07
08         The context of this namespace must be a datetime object, 
09         otherwise an exception is raised.
10         """
11
12     def fullTime(self):
13         """Returns the full time using the user's locale.
14
15         The context of this namespace must be a datetime object, 
16         otherwise an exception is raised.
17         """
18
19     def fullDateTime(self):
20         """Returns the full datetime using the user's locale.
21 
22         The context of this namespace must be a datetime object, 
23         otherwise an exception is raised.
24         """


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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