ship/computer/browser/computer.py: 1 from zope.publisher.browser import BrowserPage 2 from zope.app.pagetemplate import ViewPageTemplateFile 3 from zope.formlib.form import EditForm, Fields 4 from ship.computer.interfaces import IComputer 5 6 class ViewComputer(BrowserPage): 7 """Simple view class for a Computer Object""" 8 __call__ = ViewPageTemplateFile('templates/computerView.pt') 9 10 class ComputerEditForm(EditForm): 11 """Basic EditForm for Editing Existing Computer Objects""" 12 form_fields = Fields(IComputer) 13 label = u"Edit Computer" ship/computer/browser/configure.zcml : 1 4 5 6 7 8 14 15 22 23 traceback for accessing http://zopeserver/CompObj/@@CompEdit.html : ------ 2007-05-22T09:34:09 ERROR SiteError http://sparky:8080/pf/@@CompEdit.html Traceback (most recent call last): File "/opt/Zope-3.1.1/lib/python/zope/publisher/publish.py", line 133, in publish result = publication.callObject(request, obj) File "/opt/Zope-3.1.1/lib/python/zope/app/publication/zopepublication.py", line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) File "/opt/Zope-3.1.1/lib/python/zope/publisher/publish.py", line 108, in mapply return debug_call(obj, args) - __traceback_info__: File "/opt/Zope-3.1.1/lib/python/zope/publisher/publish.py", line 114, in debug_call return obj(*args) File "/opt/Zope-3.1.1/lib/python/zope/formlib/form.py", line 769, in __call__ self.update() File "/opt/Zope-3.1.1/lib/python/zope/formlib/form.py", line 732, in update self.setUpWidgets() File "/opt/Zope-3.1.1/lib/python/zope/formlib/form.py", line 802, in setUpWidgets adapters=self.adapters, ignore_request=ignore_request File "/opt/Zope-3.1.1/lib/python/zope/formlib/form.py", line 393, in setUpEditWidgets widget = _createWidget(form_field, field, request, iface) File "/opt/Zope-3.1.1/lib/python/zope/formlib/form.py", line 323, in _createWidget return component.getMultiAdapter((field, request), iface) File "/opt/Zope-3.1.1/lib/python/zope/component/_api.py", line 101, in getMultiAdapter adapter = queryMultiAdapter(objects, interface, name, context=context) File "/opt/Zope-3.1.1/lib/python/zope/component/_api.py", line 114, in queryMultiAdapter return sitemanager.queryMultiAdapter(objects, interface, name, default) File "/opt/Zope-3.1.1/lib/python/zope/component/registry.py", line 206, in queryMultiAdapter return self.adapters.queryMultiAdapter( File "/opt/Zope-3.1.1/lib/python/zope/interface/adapter.py", line 482, in queryMultiAdapter result = factory(*objects) File "/opt/Zope-3.1.1/lib/python/zope/app/component/metaconfigure.py", line 160, in __call__ return proxify(self.factory(*objects), self.checker) File "/opt/Zope-3.1.1/lib/python/zope/app/form/browser/itemswidgets.py", line 56, in CollectionInputWidget IInputWidget) File "/opt/Zope-3.1.1/lib/python/zope/component/_api.py", line 103, in getMultiAdapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((, None, ), , u'') 127.0.0.1 - - [22/May/2007:09:34:09 -0230] "GET /pf/@@CompEdit.html HTTP/1.1" 500 84 "http://sparky:8080/@@contents.html" "Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.4 (like Gecko)" ship.computer.interfaces.IComputer: 24 class IComputer(Interface): 25 """Store information about a computer Object. 26 """ 27 28 ipAddress = TextLine(title = u"IP Address", 29 description = u"IP Address of the Computer Object", 30 constraint = validate_ip, 31 required = True) 32 33 macAddress = TextLine(title = u"MAC Address", 34 description = u"MAC Address of the Computer Object", 35 constraint = validate_mac, 36 required = True 37 ) 38 39 hostname = TextLine(title = u"Hostname", 40 description = u"Human Readable Computer Identifier", 41 default = u"none" 42 ) 43 44 room = TextLine(title = u"Room Number", 45 description = u"Room where the Computer is located", 46 default = u"none" 47 ) 48 49 wallplate = TextLine(title = u"Wallplate Number", 50 description = u"Identifier for C&C, so they know where the Computer\ 51 is plugged in", 52 required = True 53 ) 54 55 users = List(title = u"Users", 56 description = u"A list of users that use this Computer.", 57 default = [u'Everyone'] 58 )