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

Chapter 31. Vocabularies and Related Fie... > Step 3: The Default Item Folder

Step 3: The Default Item Folder

To see the vocabulary working, you can develop a special folder that simply keeps track of a default item (whatever default may mean in the context). Because the folder is part of a browser demonstration, you place the following folder interface and implementation of the folder in the file browser.py:

01 from zope.interface import implements, Interface
02 from zope.schema import Choice
03 from zope.app.folder import Folder
04
05 class IDefaultItem(Interface):
06
07     default = Choice(
08         title=u"Default Item Key",
09         description=u"Key of the default item in the folder.",
10         vocabulary="Items")
11
12 class DefaultItemFolder(Folder):
13     implements(IDefaultItem)
14
15     default = None


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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