[Zope3-dev] practical example of migrating from services to utilities

nagendra kumar taraka_nagendra at akebonosoft.com
Thu Sep 1 10:20:41 EDT 2005


Hello All,
	I have a method which is working well in zope3.0 but its not working well in Zope3.1 c2 version.
	I am new to zope3 framework.I think services have no support in zope3.1.what do i need to do to make it work.
	I think i have to use either adpaters or utilities for this task.
	Somebody please send me a cod snippet to make it work.

	I am putting my code snippet below

	from zope.app.publisher.browser import BrowserView
	from zope.app.exception.interfaces import UserError
	from zope.app.pluggableauth.interfaces import IPluggableAuthentication
	from zope.app.securitypolicy.interfaces import IPrincipalRoleManager
	_ = MessageIDFactory('mynewsite')

	from mynewsite.interfaces import ISignupPrincipalSource

	def _getPrincipalSource(self):
			# I am getting error at below place when signing up
			pluggableauth = zapi.getService(zapi.servicenames.Authentication,context=self.context)
			if not IPluggableAuthentication.providedBy(pluggableauth):
				raise LookupError, "Signup requires a pluggableauth instance."
			for principal_source in pluggableauth.values():
				if ISignupPrincipalSource.providedBy(principal_source):
					return principal_source
			raise TypeError, "Signup requires a SignupPrincipalSource."
	Thanks in advance
Regards
-Nagendra Kumar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-dev/attachments/20050901/43586145/attachment.htm


More information about the Zope3-dev mailing list