|
From: Daniel N. <dpu...@us...> - 2004-05-02 12:16:59
|
Update of /cvsroot/archetypes/Archetypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26350 Modified Files: Tag: release-1_3-branch Field.py ReferenceEngine.py Log Message: Added some comments and wrapped lines here and there... Index: Field.py =================================================================== RCS file: /cvsroot/archetypes/Archetypes/Field.py,v retrieving revision 1.183.2.5 retrieving revision 1.183.2.6 diff -u -d -r1.183.2.5 -r1.183.2.6 --- Field.py 29 Apr 2004 20:05:23 -0000 1.183.2.5 +++ Field.py 2 May 2004 12:16:49 -0000 1.183.2.6 @@ -231,11 +231,12 @@ # check if we are allowed to use the validators # Don't validate if the field is empty and not required # XXX: This is a temporary fix. Need to be fixed right for AT 2.0 - # content_edit / BaseObject.processForm() calls widget.process_form - # a second time! + # content_edit / BaseObject.processForm() calls + # widget.process_form a second time! isEmpty = False if self.validators: widget = self.widget + # XXX: the comment below is absurd # XXX: required for unit test request = getattr(instance, 'REQUEST', None) if request: @@ -243,11 +244,12 @@ result = widget.process_form(instance, self, form, empty_marker=_marker, emptyReturnsMarker=True) - if result is _marker or result is None: # FileWidget returns None + if result is _marker or result is None: + # XXX: FileWidget returns None isEmpty = True - return self.validate_validators(value, instance=instance, errors=errors, - isEmpty=isEmpty, **kwargs) + return self.validate_validators(value, instance, errors, isEmpty, + **kwargs) def validate_validators(self, value, instance, errors, isEmpty, **kwargs): """ Index: ReferenceEngine.py =================================================================== RCS file: /cvsroot/archetypes/Archetypes/ReferenceEngine.py,v retrieving revision 1.35 retrieving revision 1.35.2.1 diff -u -d -r1.35 -r1.35.2.1 --- ReferenceEngine.py 19 Apr 2004 21:56:44 -0000 1.35 +++ ReferenceEngine.py 2 May 2004 12:16:50 -0000 1.35.2.1 @@ -268,11 +268,11 @@ return brains - def _uidFor(self, object): + def _uidFor(self, obj): # We should really check for the interface but I have an idea # about simple annotated objects I want to play out - if type(object) not in STRING_TYPES: - uobject = object.aq_base + if type(obj) not in STRING_TYPES: + uobject = obj.aq_base if not self.isReferenceable(uobject): raise ReferenceException @@ -281,11 +281,11 @@ else: uuid = getattr(uobject, UUID_ATTR) else: - uuid = object + uuid = obj #and we look up the object uid_catalog = getToolByName(self, UID_CATALOG) brains = uid_catalog(UUID=uuid) - object = brains[0].getObject() + obj = brains[0].getObject() return uuid, object |