{ "info": { "author": "LOGILAB S.A. (Paris, FRANCE)", "author_email": "contact@logilab.fr", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: CubicWeb", "Programming Language :: JavaScript", "Programming Language :: Python" ], "description": "General description\n===================\n\nPreview cube adds the ability to preview the effect of a form submission.\n\nThe main idea is:\n\n* submit the form data to a special controller, that will\n insert / update data in the database transaction, as normal\n\n* generate the preview\n\n* rollback the database changes to leave the database unchanged\n\nThe only exceptions to this rules are downloadable entities, like images : when\nan html page (as a preview example view) that contains newly created / updated\nimages is rendered, the actual image content is queried by users' browser a\nwhile after the above-mentionned database rollback was performed. The solution\nadopted in this cube is to save such contents on the disk, and keep it for some\ntime (that can be set using the preview-time option) so that it can be previewed\nand clean it up afterwards.\n\nUsage\n=====\n\nSimplest usage concerns automatic entity forms, where you generally want to\npreview the just created or updated entity : in this case, import\nPreviewFormMixin from cubicweb_preview.utils and make your form inherit it :\nyou're done. For example, to apply it to all AutomaticEntityForm forms, use::\n\n from cubicweb.selectors import yes\n from cubicweb.web.views.autoform import AutomaticEntityForm\n from cubicweb_preview.views.forms import PreviewFormMixin\n\n class PreviewAutomaticEntityForm(PreviewFormMixin, AutomaticEntityForm):\n __select__ = AutomaticEntityForm.__select__ & yes()\n\nYou can of course customize the preview, using PreviewFormMixin preview_vid\nand preview_rql attributes, that will be used by the controller to create a\nresult set (using preview_rql, if not None) and apply a view (which name is\npreview_vid value, default to \"index\") to it.\n\nBelow is an example for a CubicWeb instance using the file and preview cubes,\nthat can be used to preview the list of all images when you add or edit one :\nwe request all images through the preview_rql setting and display them using\nthe primary view ::\n\n from cubicweb.selectors import is_instance\n from cubicweb.web.views.autoform import AutomaticEntityForm\n from cubicweb_preview.views.forms import PreviewFormMixin\n\n class ImageForm(PreviewFormMixin, AutomaticEntityForm):\n __select__ = AutomaticEntityForm.__select__ & is_instance('Image')\n preview_vid = 'primary'\n preview_rql = 'Any X WHERE X is Image'\n preview_mode = 'inline'\n\nNote that the previously created images are stored in the database while the\npreviewed one is temporarily stored on disk. By default, the previewed image\nwill be kept for one hour on disk, which can be set using the preview-store-time\noption.\n\nThe `preview_mode` attribute accepts `newtab` (the default, opening\nthe preview in a new browser windows/tab within a custom template), or\n`inline` (will show the preview below the form).\n\n\n\nAuthors\n=======\n\nThis cube has been written by SecondWeb S.A.S. and is now maintained\nand developped by Logilab S.A.\n\nLicense\n=======\n\nThis cube is distributed under the LGPL-2 license.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.cubicweb.org/project/cubicweb-preview", "keywords": "", "license": "LGPL", "maintainer": "", "maintainer_email": "", "name": "cubicweb-preview", "package_url": "https://pypi.org/project/cubicweb-preview/", "platform": "", "project_url": "https://pypi.org/project/cubicweb-preview/", "project_urls": { "Homepage": "https://www.cubicweb.org/project/cubicweb-preview" }, "release_url": "https://pypi.org/project/cubicweb-preview/1.5.0/", "requires_dist": null, "requires_python": "", "summary": "Enables adding a preview button in your forms", "version": "1.5.0" }, "last_serial": 5978297, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "18b691b655d1cc961b9ae286f5124395", "sha256": "2e36f6374b34b3a61b149cc67d63556be5158e55b4014fc478649b765d45babc" }, "downloads": -1, "filename": "cubicweb-preview-0.2.1.tar.gz", "has_sig": false, "md5_digest": "18b691b655d1cc961b9ae286f5124395", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11032, "upload_time": "2012-08-08T11:51:03", "url": "https://files.pythonhosted.org/packages/38/57/f9056b9045cc75ed084d125f1dcfb71ae808259ca669b90da15bd58ecf3c/cubicweb-preview-0.2.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "f00dcf80d66952920cbc3a3ffd22716c", "sha256": "20ccbe35747e1c7189ed4d73fe25228846df88a9f7ccb9831f2bf5f2d93442ea" }, "downloads": -1, "filename": "cubicweb-preview-1.0.0.tar.gz", "has_sig": false, "md5_digest": "f00dcf80d66952920cbc3a3ffd22716c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14176, "upload_time": "2013-04-05T14:25:52", "url": "https://files.pythonhosted.org/packages/ca/8f/530b9f3eaa6ba4844d1e1da01bd6e5e7c47010555c9e1f83f9f23b5c64a2/cubicweb-preview-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "30a3a0e632d277c222eed53d15dd7b08", "sha256": "a8ba874600437dced2ce288f1b2d987d21fc6da9ac52ca17ec9a90fb53600840" }, "downloads": -1, "filename": "cubicweb-preview-1.1.0.tar.gz", "has_sig": false, "md5_digest": "30a3a0e632d277c222eed53d15dd7b08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14237, "upload_time": "2014-02-04T08:03:35", "url": "https://files.pythonhosted.org/packages/d7/e5/acee783864cea31e4aa3e1dddcf3cc84aa959a5ac582a130d14c4b098fa5/cubicweb-preview-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "06a488a84592f206432f7ce303eba14c", "sha256": "ec32d5a8fff7a353f010af84eec53021047167d5bddb48b7c0cba49f3859fb64" }, "downloads": -1, "filename": "cubicweb-preview-1.1.1.tar.gz", "has_sig": false, "md5_digest": "06a488a84592f206432f7ce303eba14c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14540, "upload_time": "2015-02-02T16:04:24", "url": "https://files.pythonhosted.org/packages/66/0c/f6280e59dd553244566b501b5dada2dc12dbff3ec197c1fcdb9ea8445c2b/cubicweb-preview-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "725570170e1dd14573e0e2367db0ce95", "sha256": "86540dab774cda7457dc449141a4f70d7a54930ca9eb34f8a3107e322d2a6283" }, "downloads": -1, "filename": "cubicweb-preview-1.1.2.tar.gz", "has_sig": false, "md5_digest": "725570170e1dd14573e0e2367db0ce95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14425, "upload_time": "2015-07-23T12:24:35", "url": "https://files.pythonhosted.org/packages/9d/f9/40e30666f5351e77caf52921994063e610ee4828b17d68a97ea7727fe78f/cubicweb-preview-1.1.2.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "8013112e7009d310b228839e55525c2e", "sha256": "8653a94829c771607be990a7b2749f46cbe11f92269cfd9f9c63c3502659d7f0" }, "downloads": -1, "filename": "cubicweb-preview-1.2.0.tar.gz", "has_sig": false, "md5_digest": "8013112e7009d310b228839e55525c2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14510, "upload_time": "2015-12-23T16:42:22", "url": "https://files.pythonhosted.org/packages/b4/a8/f14b67ccb045d633c0cffaaafb10908656cc12a0d571261d03b0afd93ee6/cubicweb-preview-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "e56b0f063246b74fd8297f20e226e1f9", "sha256": "3571dd8d2607ff5e390adc9c0fb080844aa7b8bd588874a680d588021f15392b" }, "downloads": -1, "filename": "cubicweb-preview-1.2.1.tar.gz", "has_sig": false, "md5_digest": "e56b0f063246b74fd8297f20e226e1f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15227, "upload_time": "2016-05-09T16:06:30", "url": "https://files.pythonhosted.org/packages/ac/46/3980e49ead6e8c1f0b8a5e3d84fb546932aaa96b51445a3c00fd24e7837e/cubicweb-preview-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "cb59c94cd2a566d2c7f8776b8e0563d1", "sha256": "889ce002e9cbaa3aafb091b5c36f67b1dcea8ca12a7272d389ad89e2ad2e142a" }, "downloads": -1, "filename": "cubicweb-preview-1.2.2.tar.gz", "has_sig": false, "md5_digest": "cb59c94cd2a566d2c7f8776b8e0563d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15232, "upload_time": "2016-05-30T10:43:58", "url": "https://files.pythonhosted.org/packages/7f/da/1b17218434c3035dc44c625792d8cd7e55d4d36a7c65df18e79ebe86b30d/cubicweb-preview-1.2.2.tar.gz" } ], "1.2.3": [ { "comment_text": "", "digests": { "md5": "6becf56d10c1f66de2e087e2d2764354", "sha256": "a6337c3bd4fcfa9ce291c894af7ca2cf483d04c3a7c9093fc44f2c6d92ded121" }, "downloads": -1, "filename": "cubicweb-preview-1.2.3.tar.gz", "has_sig": false, "md5_digest": "6becf56d10c1f66de2e087e2d2764354", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15241, "upload_time": "2016-06-02T12:42:48", "url": "https://files.pythonhosted.org/packages/1c/22/1ee8dd80138a7a5cc3b938fe7fa0d21bc42b8ab4a85066b4b59c2625f472/cubicweb-preview-1.2.3.tar.gz" } ], "1.2.4": [ { "comment_text": "", "digests": { "md5": "3bed7036312d9108363ac098441bdabe", "sha256": "d371d2281eef406b5ee4b79a360f43797443130e82c8d350e1dc116375c359fe" }, "downloads": -1, "filename": "cubicweb-preview-1.2.4.tar.gz", "has_sig": false, "md5_digest": "3bed7036312d9108363ac098441bdabe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15941, "upload_time": "2016-11-21T14:23:13", "url": "https://files.pythonhosted.org/packages/72/a1/1e4e8a7c4a5fd5a157201071f4663220c0670740dbebb86cc5407e5efc8b/cubicweb-preview-1.2.4.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "2c2b5b5fb2ecfd2abf80810123b46e26", "sha256": "0f0eeae4a09abc34e93008e5bfaffd544c3a30186de318e0cc3d675ec23757c4" }, "downloads": -1, "filename": "cubicweb-preview-1.4.0.tar.gz", "has_sig": false, "md5_digest": "2c2b5b5fb2ecfd2abf80810123b46e26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13981, "upload_time": "2019-03-05T13:58:53", "url": "https://files.pythonhosted.org/packages/f9/57/793e5f8cbdcfd10dddd4fa306a96263c8948359740d888d9e143e9620e53/cubicweb-preview-1.4.0.tar.gz" } ], "1.5.0": [ { "comment_text": "", "digests": { "md5": "53e99b50f2ab16608c0628daaa85f5bc", "sha256": "d7f44ba26f4fd5b23610f21570539ec94bd8643db7bd3bc5db4931419ea4de20" }, "downloads": -1, "filename": "cubicweb-preview-1.5.0.tar.gz", "has_sig": false, "md5_digest": "53e99b50f2ab16608c0628daaa85f5bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14002, "upload_time": "2019-10-15T16:25:38", "url": "https://files.pythonhosted.org/packages/81/ab/f58161f9ac1316253dd806d1a6ffe0d686be99a0cd27654d2686d72659db/cubicweb-preview-1.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "53e99b50f2ab16608c0628daaa85f5bc", "sha256": "d7f44ba26f4fd5b23610f21570539ec94bd8643db7bd3bc5db4931419ea4de20" }, "downloads": -1, "filename": "cubicweb-preview-1.5.0.tar.gz", "has_sig": false, "md5_digest": "53e99b50f2ab16608c0628daaa85f5bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14002, "upload_time": "2019-10-15T16:25:38", "url": "https://files.pythonhosted.org/packages/81/ab/f58161f9ac1316253dd806d1a6ffe0d686be99a0cd27654d2686d72659db/cubicweb-preview-1.5.0.tar.gz" } ] }