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

Chapter 36. Registering New WebDAV Names... > Step 1: Creating the Namespace Schem...

Step 1: Creating the Namespace Schema

The schema of the photo should contain some information that is usually provided by the camera. To implement the schema, you open a new file called interfaces.py and add the following code to it:

01 from zope.interface import Interface
02 from zope.schema import Text, TextLine, Int, Float
03
04 photodavns = "http://namespaces.zope.org/dav/photo/1.0"
05
06 class IPhoto(Interface):
07     """A WebDAV namespace to store photo-related meta data.
08
09     The 'IPhoto' schema/namespace can be used in WebDAV clients to determine
10     information about a particular picture. Obviously, this namespace makes
11     only sense on Image objects.
12     """
13
14     height = Int(
15         title=u"Height",
16         description=u"Specifies the height in pixels.",
17         min=1)
18
19     width = Int(
20         title=u"Width",
21         description=u"Specifies the width in pixels.",
22         min=1)
23
24     equivalent35mm = TextLine(
25         title=u"35mm equivalent",
26         description=u"The photo's size in 35mm is equivalent to this amount")
27
28     aperture = TextLine(
29         title=u"Aperture",
30         description=u"Size of the aperture.")
31
32     exposureTime = Float(
33         title=u"Exposure Time",
34         description=u"Specifies the exposure time in seconds.")


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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