{ "info": { "author": "Wichert Akkerman", "author_email": "wichert@wiggy.net", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Zope2", "License :: OSI Approved :: Zope Public License", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Introduction\n============\n\nThis package provides a hook into Zope's ZPublisher that is run after\nthe publisher has completed traversal and authentication, but before\nit tries to publish an object. This is practical for tasks such as\ntracking user activity.\n\nHooks use `zope.event`_'s event mechanism using the\nplone.validatehook.interfaces.IPostValidationEvent. This is based on\nthe standard ObjectEvent form `zope.component`_. \n\nThe IPostValidationEvent event has two attributes: ``user`` which is the\ncurrently authenticated user object and ``request``, which is the current\nrequest object. \n\n *Keep in mind that even unauthenticated requests have a user\n object. If you only want to deal with 'normal' users make sure\n you ignore any instances of AccessControl.User.SpecialUser.*\n\n\nExample\n=======\n\nAs an example we will write a bit of code which logs the id of the\ncurrent user and the path to the current code. This is the code for\nthe event handler::\n\n from zope.interface import Interface\n from zope.component import adapter\n from plone.validatehook.interfaces import IPostValidationEvent\n import logging\n\n logger = logging.getLogger(\"LogRequest\")\n\n @adapter(Interface, IPostValidationEvent)\n def LogRequest(object, event):\n if getattr(object, \"getPhysicalPath\", None) is None:\n path=\"Unknown path\"\n else:\n path=\"/\".join(object.getPhysicalPath()\n\n logger.info(\"Request from user '%s' for object %s\" %\n event.user.getId(), path)\n\nTo use this code you need to register it in zcml::\n\n \n\n\n.. _zope.component: http://pypi.python.org/pypi/zope.component\n.. _zope.event: http://pypi.python.org/pypi/zope.event\n\n\nChangelog\n=========\n\n1.0 - October 15, 2008\n----------------------\n\n* Move to svn.zope.org and relicense under ZPL.\n [wichert]\n\n\n1.0rc1 - July 15, 2008\n----------------------\n\n* Initial release\n [wichert]", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "", "license": "ZPL", "maintainer": null, "maintainer_email": null, "name": "plone.validatehook", "package_url": "https://pypi.org/project/plone.validatehook/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/plone.validatehook/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/plone.validatehook/1.0/", "requires_dist": null, "requires_python": null, "summary": "Zope 2 publisher validation hook", "version": "1.0" }, "last_serial": 796439, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "dee17ae09fece540350b3961526abda6", "sha256": "1f790be5a942c67cb8b66b3e5c3224c02835098f4cd612c1c67425eae7ee935f" }, "downloads": -1, "filename": "plone.validatehook-1.0.zip", "has_sig": false, "md5_digest": "dee17ae09fece540350b3961526abda6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10199, "upload_time": "2008-10-15T08:15:12", "url": "https://files.pythonhosted.org/packages/ea/c2/276c917b8458b1f149b84b63171addfe26dbee934bf3c738b2dee964c992/plone.validatehook-1.0.zip" } ], "1.0rc1": [ { "comment_text": "", "digests": { "md5": "c71d4a3b27283731bc1b93df12bd4eb5", "sha256": "7606a1f774ed573293dde1bd983813b3a3154ebbf68e9e3166ac9e23482949b6" }, "downloads": -1, "filename": "plone.validatehook-1.0rc1.tar.gz", "has_sig": false, "md5_digest": "c71d4a3b27283731bc1b93df12bd4eb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8280, "upload_time": "2008-07-15T15:51:21", "url": "https://files.pythonhosted.org/packages/92/28/ab99b9b9eed05cc4f7de107b3c2e7be857727d0b40aef18cd09dc538ab34/plone.validatehook-1.0rc1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dee17ae09fece540350b3961526abda6", "sha256": "1f790be5a942c67cb8b66b3e5c3224c02835098f4cd612c1c67425eae7ee935f" }, "downloads": -1, "filename": "plone.validatehook-1.0.zip", "has_sig": false, "md5_digest": "dee17ae09fece540350b3961526abda6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10199, "upload_time": "2008-10-15T08:15:12", "url": "https://files.pythonhosted.org/packages/ea/c2/276c917b8458b1f149b84b63171addfe26dbee934bf3c738b2dee964c992/plone.validatehook-1.0.zip" } ] }