[Zope3-checkins] CVS: Zope3/src/zope/app/services - field.py:1.3
Steve Alexander
steve@cat-box.net
Thu, 9 Jan 2003 12:29:17 -0500
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv16296/src/zope/app/services
Modified Files:
field.py
Log Message:
Renamed ComponentLocation field to ComponentPath field in preparation
for a true ComponentLocation field.
=== Zope3/src/zope/app/services/field.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/field.py:1.2 Wed Dec 25 09:13:19 2002
+++ Zope3/src/zope/app/services/field.py Thu Jan 9 12:28:44 2003
@@ -24,7 +24,7 @@
from zope.app.component.interfacefield import InterfaceField
from zope.exceptions import NotFoundError
-class IComponentLocation(IField):
+class IComponentPath(IField):
"""A field containing a component path.
"""
@@ -32,20 +32,21 @@
title = u"An interface that must be implemented by the component.",
required = True,
readonly = True,
+ basetype = None
)
-class ComponentLocation(Field):
+class ComponentPath(Field):
- __implements__ = IComponentLocation
+ __implements__ = IComponentPath
_type = unicode
def __init__(self, type, *args, **kw):
self.type = type
- super(ComponentLocation, self).__init__(*args, **kw)
+ super(ComponentPath, self).__init__(*args, **kw)
def _validate(self, value):
- super(ComponentLocation, self)._validate(value)
+ super(ComponentPath, self)._validate(value)
if not value.startswith('/'):
raise ValidationError("Not an absolute path", value)
@@ -56,4 +57,6 @@
raise ValidationError("Path for non-existent object", value)
if not self.type.isImplementedBy(component):
- raise ValidationError("Wrong component type")
+ raise ValidationError("Wrong component type", value)
+
+