{ "info": { "author": "Sylvain Viollon", "author_email": "thefunny@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Zope2", "Framework :: Zope3", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "================\nzeam.utils.batch\n================\n\nThis package provides a batch functionality for Zope 2, Zope 3 and Grok.\n\n.. contents::\n\nExample\n=======\n\nA very straightforward example. We need to define a context to work\non::\n\n >>> import grokcore.view as grok\n >>> from persistent import Persistent\n >>> from zope.component import queryMultiAdapter\n >>> from zeam.utils.batch import Batch\n >>> from zeam.utils.batch.interfaces import IBatching\n\n >>> class Content(Persistent):\n ... pass\n\n\nAnd now, you can define a view which use a batch, and render it::\n\n >>> class MyViewClass(grok.View):\n ... grok.context(Content)\n ...\n ... def update(self):\n ... fulllist = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n ... self.myitems = Batch(\n ... fulllist , count=3, name='nbs', request=self.request,\n ... factory=lambda x: str(x))\n ...\n ... self.batch = queryMultiAdapter(\n ... (self, self.myitems, self.request),\n ... IBatching)()\n ...\n ... template = grok.PageTemplate('''\n ... \n ... \n ... \n ... ''')\n\nAnd this work::\n\n >>> from grokcore.component import testing\n >>> testing.grok_component(\"view\", MyViewClass)\n True\n\n >>> from zope.publisher.browser import TestRequest\n >>> request = TestRequest()\n\n >>> root = getRootFolder()\n >>> root['myObject'] = Content()\n >>> myobj = root['myObject']\n\n >>> view = queryMultiAdapter((myobj, request), name=\"myviewclass\")\n >>> \"batchNav\" in view()\n True\n\n\nAPI\n===\n\n``Batch``\n This object implements the batch.\n\n The batch object is instanciated with the following arguments:\n\n - a list of the objects to batch\n\n - the request\n\n - the number of items per page (as count, default to 10)\n\n - a name (optional)\n\n - a factory that will be passed each item before each iteration (optional)\n\n The batch is an iterable object behaving like a list.\n It only gives access to the set of objects for the current page.\n\n It provides the number of pages generated and the current position.\n Please refer to the interface, for more information.\n\n A multi adapter providing ``IBatching`` can render the batch.\n It adapts the context, the batch object and the request. The __call__\n method of this component will return a snippet of HTML containing\n basic controls for your batch: a next and previous link and a direct\n access to the other pages.\n\n``DateBatch``\n This object implements a batch for date range. It follows the same\n API than the regular batch, except:\n\n - the list of objects is replaced by a callable that takes a\n datetime value has parameter and return a list of objects for the\n given periode\n\n - the count option is changed to use either the ``BATCH_DAY`` or\n ``BATCH_MONTH`` marker object.\n\n\nChangelog\n=========\n\n1.1 (2012-09-24)\n----------------\n\n* Add a new type of batch, AlphabeticalBatch, that like the DateBatch,\n and can be used to iterate through a fixed set of items like letters\n or digits.\n\n* Fix a bug when the ``start`` value is higher than the number of\n element in the batch in the regular batch.\n\n* Add two options ``min`` and ``max`` to the date batch in order to\n define possible limits for it.\n\n1.0 (2011-11-07)\n----------------\n\n* Add a new batch component, ``DateBatch``, which is able to browser\n period of years or months.\n\n* ``batch`` is renamed into ``Batch``. Methods have been renamed to\n follow pep8 recommandations (i.e. ``batchLen`` into ``batch_length``).\n\n* Template have been reviewed: values are accessible via the template\n variable ``batch`` insted of directly. This fix an issue of\n compatiblity with Chameleon, where ``next`` could not be defined\n (that's a Python built-in).\n\n0.7 (2010-10-05)\n----------------\n\n* Add a __len__ method do a batch object, which returns the number of\n objects viewable via this current batch. Like this, it can be used\n with tal:condition in templates.\n\n* An option keep_form_data on the view prevent to include posted form\n data in generated links (sometime you want them, some other you\n don't).\n\n0.6 (2010-07-15)\n----------------\n\n* Generated batch links can include other parameters in the link. That\n let you batch form results for instance.\n\n\n0.5 (2009-11-17)\n----------------\n\n* Batching views have two new properties: ``first`` and ``last`` which\n gives links to the first and last batch.\n\n0.4.1 (2009-10-16)\n------------------\n\n* Corrected the broken distribution that was missing the i18n folder.\n\n0.4 (2009-10-16)\n----------------\n\n.. note::\n\n This release is incompatible with previous ones. You are recomanded\n to review and adapt your code in order to use it.\n\n* Added README.txt as a doctest [trollfot]\n* The rendering is made by a IPageTemplate component, not longer by\n the Batching itself. [trollfot]\n* We no longer use the IBatchedContent. It has been removed. [trollfot]\n* `zeam.utils.batch` is now fully grokked. [trollfot]\n* batchView has been renamed Batching. [trollfot]\n* You adapt the batch with the view on which you display the batch:\n its name will keep when generating links,\n* Batch can be *disabled* with a count of 0,\n* Add translations for french, english and dutch.\n\n0.3 (2008-10-18)\n----------------\n\n* Fix and add tests,\n* Don't display batch navigation if everything fits on one page,\n* No more special links are generated for the first page of the batch.\n\n0.2\n---\n\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/thefunny42/Zeam-Utils-Batch", "keywords": "batch zope", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "zeam.utils.batch", "package_url": "https://pypi.org/project/zeam.utils.batch/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zeam.utils.batch/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/thefunny42/Zeam-Utils-Batch" }, "release_url": "https://pypi.org/project/zeam.utils.batch/1.1/", "requires_dist": null, "requires_python": null, "summary": "Generic Batch support for Zope", "version": "1.1" }, "last_serial": 2973096, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "67353255af5088fc4116a7c393affe5e", "sha256": "385f70112b32f6b5f7efb853e2698e75d024a245fa714b33f33f1d6fd8f25e11" }, "downloads": -1, "filename": "zeam.utils.batch-0.2-py2.4.egg", "has_sig": false, "md5_digest": "67353255af5088fc4116a7c393affe5e", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 13778, "upload_time": "2008-07-31T08:16:31", "url": "https://files.pythonhosted.org/packages/31/3a/b11c5baa91b951563a00b7ccfb94bcf49af805a246e6faa04cadbc6aec5d/zeam.utils.batch-0.2-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "763fcd799a41ec9142c114d77fc314ce", "sha256": "eed5a8c9d2b4ebce1106c2425778fc038a6e4c8e135ed421166d88f32077a213" }, "downloads": -1, "filename": "zeam.utils.batch-0.2.tar.gz", "has_sig": false, "md5_digest": "763fcd799a41ec9142c114d77fc314ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5140, "upload_time": "2008-07-31T08:16:35", "url": "https://files.pythonhosted.org/packages/01/6e/ac336bd1a8ec35614faf5a670dd21ca9be3ff84454d1164f9cf96fa80b77/zeam.utils.batch-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "e8c08a140ec7f8fa6c033beaaffb6ec9", "sha256": "6e4b89d2be37d304b2ec10a7429278fad2a1399ba71789e38ee6b04dd1fa8b4b" }, "downloads": -1, "filename": "zeam.utils.batch-0.3-py2.4.egg", "has_sig": false, "md5_digest": "e8c08a140ec7f8fa6c033beaaffb6ec9", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 16639, "upload_time": "2008-10-18T00:33:50", "url": "https://files.pythonhosted.org/packages/29/c4/97acec3b90452c5747c40ded6a857a7e97411f03d52a79b9d306189c5184/zeam.utils.batch-0.3-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "6a33fa0f8523fedb95dfca24f0a5216b", "sha256": "96a5181e357b3ecfe5e806ba1641473e2439ba0c5fd2c36a81fac2cd79b93428" }, "downloads": -1, "filename": "zeam.utils.batch-0.3.tar.gz", "has_sig": false, "md5_digest": "6a33fa0f8523fedb95dfca24f0a5216b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8262, "upload_time": "2008-10-18T00:33:10", "url": "https://files.pythonhosted.org/packages/22/7e/55c5d4b6d0d58d600b74fae59d204cfb78e19b597dabce41fbb2fe9caba1/zeam.utils.batch-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "c3cae7c4ed15d13564ccee3196b08be7", "sha256": "1a97e3670d1d06b3e3f1718f78b9d8d086af11a69433601b263038f85eaa7666" }, "downloads": -1, "filename": "zeam.utils.batch-0.4.tar.gz", "has_sig": false, "md5_digest": "c3cae7c4ed15d13564ccee3196b08be7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8508, "upload_time": "2009-10-16T12:55:05", "url": "https://files.pythonhosted.org/packages/3e/62/c6e26d37dce77fbe1335a599fa05220ee580c4c3f0083be3407eb6168be7/zeam.utils.batch-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "25503627716e0669c8d7df8b4fa8715f", "sha256": "80089e9d37ed9441a9efa4c65aa796c2452e5a98712cd0cf3f9125a47d619a5e" }, "downloads": -1, "filename": "zeam.utils.batch-0.4.1.tar.gz", "has_sig": false, "md5_digest": "25503627716e0669c8d7df8b4fa8715f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8830, "upload_time": "2009-10-16T19:13:09", "url": "https://files.pythonhosted.org/packages/9d/41/ed8b52ed36a5172396b45c2b056c4dffa8e238aa018378f32680916bf4a6/zeam.utils.batch-0.4.1.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "3d7733634f42f08762701e1deae0fd3c", "sha256": "cde62615bcfbb958267d56e9019f9fa7b43d4f7efd218b88cf28eb2f0ad2b5f3" }, "downloads": -1, "filename": "zeam.utils.batch-0.5.tar.gz", "has_sig": false, "md5_digest": "3d7733634f42f08762701e1deae0fd3c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10624, "upload_time": "2009-11-17T19:52:53", "url": "https://files.pythonhosted.org/packages/5d/83/3ccad874442a31caeaf8b172c8eef1565f720d6952a799bd0698a5451e74/zeam.utils.batch-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "0c565e52d71f28832de9331bcafd807a", "sha256": "0acfe3c3ee6d9829d599b70a7558950d16dca77f59657e7f77a551232cf1d1a0" }, "downloads": -1, "filename": "zeam.utils.batch-0.6.tar.gz", "has_sig": false, "md5_digest": "0c565e52d71f28832de9331bcafd807a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9856, "upload_time": "2010-07-15T10:17:52", "url": "https://files.pythonhosted.org/packages/ae/ed/e5fc832ef8e04a721020132f9c7c70a3fd99807b028e052f69e7a1f5f20e/zeam.utils.batch-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "6144d12a96f91f284afd24b0879f6cf8", "sha256": "be022a4f8887d4855add7ad61150268cf30b3ab05574d230e0232348d65b9d56" }, "downloads": -1, "filename": "zeam.utils.batch-0.7.tar.gz", "has_sig": false, "md5_digest": "6144d12a96f91f284afd24b0879f6cf8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10351, "upload_time": "2010-10-05T15:37:40", "url": "https://files.pythonhosted.org/packages/dc/44/83e35c66034d776f7d5036d64cb25f52c19ebea5f3052e7c147599a3d0a4/zeam.utils.batch-0.7.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "88818d9f88b5a66c12bc18b01aa38a94", "sha256": "2ef873c230e7ee482430964347bb0903d3b74dd51a7c7afc0e0da499e02dd06a" }, "downloads": -1, "filename": "zeam.utils.batch-0.7.1.tar.gz", "has_sig": false, "md5_digest": "88818d9f88b5a66c12bc18b01aa38a94", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10575, "upload_time": "2011-11-22T09:21:36", "url": "https://files.pythonhosted.org/packages/44/3c/d4e71fe6b73c7468f97eba3481d44a4f3a503eb714fece2a541030b98f60/zeam.utils.batch-0.7.1.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "1f2085b12419d4f384ab9cd20ee93ed1", "sha256": "78aeaa333c7dd8a4af01a5d7213fe8658d70ad8ce135f7cbbe6cb9883ae5d07e" }, "downloads": -1, "filename": "zeam.utils.batch-1.0.tar.gz", "has_sig": false, "md5_digest": "1f2085b12419d4f384ab9cd20ee93ed1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12785, "upload_time": "2011-11-07T14:13:34", "url": "https://files.pythonhosted.org/packages/60/ce/f38f01716d68dc1eb2b718de4f53e4b5672b65c0e0f339af32f2a5909f96/zeam.utils.batch-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "cc1b2aecc26afc7d4f145fe4bcd597c7", "sha256": "d30c94cf9544d6c9dacf95a0f0c25739edbe8be7656056dd26e4cf9b63db1629" }, "downloads": -1, "filename": "zeam.utils.batch-1.1.tar.gz", "has_sig": false, "md5_digest": "cc1b2aecc26afc7d4f145fe4bcd597c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15085, "upload_time": "2012-09-24T06:38:56", "url": "https://files.pythonhosted.org/packages/16/06/6b9aad850b9f21db15a206fbda6b9de819ca339e199bcf6873ebf26dfd4b/zeam.utils.batch-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cc1b2aecc26afc7d4f145fe4bcd597c7", "sha256": "d30c94cf9544d6c9dacf95a0f0c25739edbe8be7656056dd26e4cf9b63db1629" }, "downloads": -1, "filename": "zeam.utils.batch-1.1.tar.gz", "has_sig": false, "md5_digest": "cc1b2aecc26afc7d4f145fe4bcd597c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15085, "upload_time": "2012-09-24T06:38:56", "url": "https://files.pythonhosted.org/packages/16/06/6b9aad850b9f21db15a206fbda6b9de819ca339e199bcf6873ebf26dfd4b/zeam.utils.batch-1.1.tar.gz" } ] }