[Zope] Pluggable Brains

Montagne, Michael montagne@BOORA.com
Tue, 7 Aug 2001 11:54:54 -0700


I'm trying to create a Pluggable Brain so I can incorporate various
functions involving employees from my ZSQL Method.

This is the SQL code:
SELECT StaffId, empfirstn, emplastn, nickname, extension, initials
FROM tblHRPersonnel INNER JOIN tblS4Emp ON tblHRPersonnel.empidno =
tblS4Emp.empidno
WHERE tblS4Emp.empactive='Y' AND tblHRPersonnel.FilterOutofWeb=False
ORDER BY tblS4Emp.emplastn;

This is the Employee.py file in the Extensions folder:
"""Employee class for extra innformation"""
class Employee:
	def fullName(self):
	"""Returns full name for employee using nickname if any"""	
		if self.nickname:
			return self.nickname + ' ' + self.emplastn
		else:
			return self.empfirstn + ' ' + self.emplastn
This is the error:
Traceback (innermost last):
  File e:\Program Files\Zope\lib\python\ZPublisher\Publish.py, line 223, in
publish_module
  File e:\Program Files\Zope\lib\python\ZPublisher\Publish.py, line 187, in
publish
  File e:\Program Files\Zope\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
    (Object: ActiveStaff)
  File e:\Program Files\Zope\lib\python\ZPublisher\Publish.py, line 171, in
publish
  File e:\Program Files\Zope\lib\python\ZPublisher\mapply.py, line 160, in
mapply
    (Object: manage_advanced)
  File e:\Program Files\Zope\lib\python\ZPublisher\Publish.py, line 112, in
call_object
    (Object: manage_advanced)
  File E:\Program Files\zope\lib\python\Shared\DC\ZRDB\DA.py, line 299, in
manage_advanced
    (Object: ActiveStaff)
  File E:\Program Files\zope\lib\python\App\Extensions.py, line 238, in
getBrain
  File E:\Program Files\zope\lib\python\App\Extensions.py, line 217, in
getObject
    (Info: ('e:\\Program Files\\Zope\\Extensions\\Employee.py', 'Employee'))
SyntaxError: (see above)