[Zope3-dev] _validate on schema fields gets called before services exist

Steve Alexander steve@cat-box.net
Sat, 21 Dec 2002 20:17:35 +0000


I'm trying to write a field that validates its contents by asking a 
service a question.

However, I can't assume that the service exists and use getService in 
the _validate method, because when zcml is read in as zope3 is started 
up, for some reason, the field's _validate gets called. I guess this is 
because the Schema I'm using the field in gets executed by the python 
interpreter.

Does _validate have to be called at this time?

What is the best thing to do when writing a Field that wants to use a 
service to help it validate things?

--
Steve Alexander