complaw@hal-pc.org writes:
... Unfortunately, my mechanism for doing so is giving me a "SyntaxError, Names starting with "_" are not allowed (__doc__)."
Here is the code...
def get_object_by_element_number(objList, given_element_number):
class MyErrorClass: "Dummy class so something is returned (with an error indicator)" element_number = -1
found = 0 for obj in objList: if given_element_number = obj.element_number: found = 1 return obj
if found == 0: error_obj = MyErrorClass return error_obj
I can do it without problem (replaced "error_obj = MyErrorClass" with "error_obj= MyErrorClass()"). Are you sure, the SyntaxError is inside this script? I expect problems when I would try to access the object in TTW code (no "SyntaxError" but an "Unauthorized" exception). I would probably go for the following solution: Provide security declarations that make "ZPublisher.HTTPRequest.Record" importable. Derive your class from "Record". Dieter