{ "info": { "author": "Lovely Systems GmbH", "author_email": "office@lovelysystems.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "==========\nPersistent\n==========\n\nThis package provides a base class for persistent objects with the advantage\nthat the object is only marked as changed if an attribute has really changed.\n\n >>> import transaction\n >>> from ZODB.tests.util import DB\n\n >>> from lovely import persistent\n\n >>> p = LovelyPersistent()\n >>> p._p_changed\n False\n\n >>> p.a = 1\n >>> db = DB()\n >>> conn = db.open()\n >>> conn.root()['p'] = p\n >>> transaction.commit()\n\nAfter commiting the changes the object is no longer in changed state.\n\n >>> p._p_changed\n False\n\nSetting a with its existing value doesn't put the object in cahnged state.\n\n >>> p.a\n 1\n >>> p.a = 1\n >>> p._p_changed\n False\n\nBut modifying a :\n\n >>> p.a = 2\n >>> p._p_changed\n True\n >>> transaction.commit()\n\n >>> p._p_changed\n False\n\nDeleting an attribute also put the object into changed state.\n\n >>> del p.a\n >>> p._p_changed\n True\n\n\nSpecial Properties\n==================\n\nSpecial property implementations do work too. To show this we use the\nfieldproperties from zope.schema.\n\n >>> from zope.schema.fieldproperty import FieldProperty\n >>> from zope import schema, interface\n >>> class IMyFace(interface.Interface):\n ... eyesOpen = schema.Bool(default=True, required=False)\n\n >>> class MyFace(persistent.Persistent):\n ... eyesOpen = FieldProperty(IMyFace['eyesOpen'])\n\n >>> persistent.tests.MyFace = MyFace\n >>> MyFace.__module__ = persistent.tests.setUp.__module__\n >>> myFace = conn.root()['myFace'] = MyFace()\n >>> transaction.commit()\n\nDefault values.\n\n >>> myFace.eyesOpen\n True\n\nValidation.\n\n >>> myFace.eyesOpen = 'not always'\n Traceback (most recent call last):\n ...\n WrongType: ('not always', )\n\nNote, setting to default value does not change the object.\n\n >>> transaction.commit()\n >>> myFace.eyesOpen = True\n >>> myFace._p_changed\n False\n\n >>> transaction.commit()\n >>> myFace.eyesOpen = False\n >>> myFace._p_changed\n True\n\n\n\n============================\nChanges in lovely.persistent\n============================\n\n2007/12/10 0.1.1\n================\n\n- moved to zope.org\n\n2007/06/19 0.1.0a1\n==================\n\n- added zodb to dependencies\n\n- added support for fieldproperties\n\n\nDownload\n**********************", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://launchpad.net/lovely.persistent", "keywords": "persistent zope zope3", "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "lovely.persistent", "package_url": "https://pypi.org/project/lovely.persistent/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/lovely.persistent/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://launchpad.net/lovely.persistent" }, "release_url": "https://pypi.org/project/lovely.persistent/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "improved ZODB persistence", "version": "0.1.1" }, "last_serial": 794368, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "04135887f1823fb30bdae96f48425a53", "sha256": "456f00bcbf7832391bd28d55112e30f11529775fc09b4990e53efa9a6b2a02ec" }, "downloads": -1, "filename": "lovely.persistent-0.1.1-py2.4.egg", "has_sig": false, "md5_digest": "04135887f1823fb30bdae96f48425a53", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 9474, "upload_time": "2007-12-10T15:16:40", "url": "https://files.pythonhosted.org/packages/dc/cc/20e1765405756bef44b1a447424263478ef2cb0916ef549806d515682899/lovely.persistent-0.1.1-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "8c9910f2cf366f51e6e41e6c7fb5fe2d", "sha256": "bb1ad68ed1288ea0a09a80b3919367d949b2854756148d902824511de74efafe" }, "downloads": -1, "filename": "lovely.persistent-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8c9910f2cf366f51e6e41e6c7fb5fe2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5405, "upload_time": "2007-12-10T15:16:40", "url": "https://files.pythonhosted.org/packages/c9/08/d216e44797d6aab22042039fef22b3d8d10a7203b33fa4b7f4f1e383c200/lovely.persistent-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "04135887f1823fb30bdae96f48425a53", "sha256": "456f00bcbf7832391bd28d55112e30f11529775fc09b4990e53efa9a6b2a02ec" }, "downloads": -1, "filename": "lovely.persistent-0.1.1-py2.4.egg", "has_sig": false, "md5_digest": "04135887f1823fb30bdae96f48425a53", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 9474, "upload_time": "2007-12-10T15:16:40", "url": "https://files.pythonhosted.org/packages/dc/cc/20e1765405756bef44b1a447424263478ef2cb0916ef549806d515682899/lovely.persistent-0.1.1-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "8c9910f2cf366f51e6e41e6c7fb5fe2d", "sha256": "bb1ad68ed1288ea0a09a80b3919367d949b2854756148d902824511de74efafe" }, "downloads": -1, "filename": "lovely.persistent-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8c9910f2cf366f51e6e41e6c7fb5fe2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5405, "upload_time": "2007-12-10T15:16:40", "url": "https://files.pythonhosted.org/packages/c9/08/d216e44797d6aab22042039fef22b3d8d10a7203b33fa4b7f4f1e383c200/lovely.persistent-0.1.1.tar.gz" } ] }