{ "info": { "author": "Marco Scheidhuber", "author_email": "j23d@jusid.de", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Pylons", "Framework :: Pyramid", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: User Interfaces" ], "description": "==============\nkotti_settings\n==============\n\nAdd a settings configuration to your Kotti site. |build status|_\n\n.. |build status| image:: https://travis-ci.org/j23d/kotti_settings.png\n.. _build status: https://travis-ci.org/j23d/kotti_settings\n\n`Find out more about Kotti`_\n\nSetup\n=====\n\nTo activate the ``kotti_settings`` add-on in your Kotti site, you need to\nadd an entry to the ``kotti.configurators`` setting in your Paste\nDeploy config. If you don't have a ``kotti.configurators`` option,\nadd one. The line in your ``[app:main]`` (or ``[app:kotti]``, depending on how\nyou setup Fanstatic) section could then look like this::\n\n kotti.configurators = kotti_settings.kotti_configure\n\nThe add-on adds a new configuration page to save settings for your module or\nacross different modules. It adds a new submenupoint named \"Settings\" to the\nmenupoint \"Site Setup\". Every setting collection is presented in one tab. It\nis intended to use one tab for a module, but it is also possible to use\nmultiple tabs if you have the need for a more extended structure.\n\nYou can choose between two modes to set up your settings. With the \"dict mode\"\nyou have a very easy and straightforward option to set up the settings. If you\nneed more advanced forms you can set up an own schema.\n\nA setting tab is set up with with a dictionary. Here you define a name and a\ntitle for your tab, what are required. Optional arguments are success_message,\neither settings or schema, schema_factory and use_csrf_token.\n\nDefine your settings in a dictionary::\n\n\tTestSettings = {\n 'name': 'test_settings',\n 'title': \"Testsettings\",\n 'description': \"Some description for my settings\",\n 'success_message': u\"Successfully saved test settings.\",\n 'settings': [\n {'type': 'String',\n 'name': 'testsetting_1',\n 'title': 'Test 1',\n 'description': 'a test setting',\n 'default': '', },\n {'type': 'Integer',\n 'name': 'testsetting_2',\n 'title': 'Test 2',\n 'description': 'again a test setting',\n 'default': 23, }]}\n\nDefine your settings with a schema::\n\n class StringSchemaNode(colander.SchemaNode):\n name = 'a_string'\n title = 'hello'\n default = 'hello world'\n\n class RangedIntSchemaNode(colander.SchemaNode):\n name = 'range_int'\n validator = colander.Range(0, 10)\n default = 5\n title = 'Ranged Int'\n\n class TestSchema(colander.MappingSchema):\n string = StringSchemaNode(colander.String())\n ranged_int = RangedIntSchemaNode(colander.Int())\n\n TestSettings = {\n 'name': 'test_settings',\n 'title': \"Testsettings\",\n 'description': \"Some description for my settings\",\n 'success_message': u\"Successfully saved test settings.\",\n 'schema_factory': TestSchema\n }\n\n\nTo get your configuration registered within ``kotti_settings`` add the\nsettings in a populator in your add-on. Have a look to the Kotti documentation\nto get more informations for populators_ and to see an example_.\n\n\nAdd your settings configuration within a populator, e.g. in a file named populate.py::\n\n def populate():\n from kotti_settings.util import add_settings\n add_settings(TestSettings)\n\nand add this to your configuration::\n\n def kotti_configure(settings):\n settings['kotti.populators'] += ' my_addon.populate.populate'\n\nor directly to your ini file::\n\n kotti.populators = my_addon.populate.populate\n\n\nTo get your setting back into your code you use the following::\n\n from kotti_settings.util import get_setting\n\n first_test_setting = get_setting('test_setting_1')\n\nEvents\n------\n\nBefore and after the settings are saved events for handling the changes are fired. To subscribe\nto the events use something like::\n\n from pyramid.events import subscriber\n from kotti_settings.events import SettingsAfterSave\n\n @subscriber(SettingsAfterSave)\n def do_something_when_settings_saved(event):\n # Check if the settings for this module was saved.\n if not event.module == __package__:\n return\n my_fancy_thing()\n\nDefault schemas\n---------------\n\n``kotti_settings`` provides some default schemas that you can use directly in your code and for\nexample purposes. Currently there are two schemas implemented, one to choose in what slot the\nwidget should be shown and another one to set the visibility of the widget. To use it in your\naddon place something like the following in your populator::\n\n from kotti.views.slots import assign_slot\n from kotti_settings.config import SlotSchemaNode\n from kotti_settings.config import ShowInContextSchemaNode\n from kotti_settings.util import add_settings\n from kotti_settings.util import get_setting\n from kotti_myaddon import _\n\n class MyWidgetSchema(colander.MappingSchema):\n slot = SlotSchemaNode(colander.String())\n show_in_context = ShowInContextSchemaNode(colander.String())\n\n MyAddonSettings = {\n 'name': 'myaddon_settings',\n 'title': _(u'My Addon Settings'),\n 'description': _(u\"Settings for my addon\"),\n 'success_message': _(u\"Successfully saved my addon settings.\"),\n 'schema_factory': MyAddonSchema,\n }\n\n def populate():\n add_settings(MyAddonSettings)\n\nYou have a full example e.g. in the addon kotti_tagcloud_.\n\n\n.. _Find out more about Kotti: http://pypi.python.org/pypi/Kotti\n.. _populators: http://kotti.readthedocs.org/en/latest/developing/configuration.html#kotti-populators\n.. _example: http://kotti.readthedocs.org/en/latest/developing/frontpage-different-template.html\n.. _kotti_tagcloud: https://pypi.python.org/pypi/kotti_tagcloud\n\n\nChangelog\n=========\n\n0.3(2016-02-29)\n---------------\n\n* Use the edit template as macro for the settings page.\n* Added deform_bootstrap to requirements, fixes #4.\n\n\n0.2(2013-11-12)\n---------------\n\n* Only scan the needed views file.\n* Added MANIFEST.in to get rid of the local folder.\n\n\n0.1(2013-10-19)\n---------------\n\n* Added documentation for the default schemas.\n* Change the implementation to check what settings form was saved.\n* Added new util method 'set_setting' where value transformations are handled.\n* Removed not needed fanstatic resources.\n* Changed the internal name of the forms to be more unique.\n* Reinitialize chosen elements when tab is shown.\n* Convert boolean to 'true' or 'false' to meet the requirements of deform's checkbox widget.\n\n\n0.1b4(2013-05-02)\n-----------------\n\n* Added a helper method for one of the default setting schemas.\n* Only save the settings from the submitted form.\n* Set the saved form as the active one.\n* Added possibility to remove a widget only from a specific slot.\n\n\n0.1b3(2013-04-18)\n------------------\n\n* Fix: Settings defined in a schema also have to be initialized.\n\n\n0.1b2(2013-04-18)\n-----------------\n\n* Added possibility to remove a widget from the slots.\n* Added two default schemas, one to select the slot for the widget and one\n to set where to show the widget.\n\n\n0.1b1(2013-03-29)\n-----------------\n\n* Added event handling for callbacks before and after the settings are saved.\n\n\n0.1a3(2013-03-13)\n-----------------\n\n* Only take the module name itself into account for the setting name.\n\n\n0.1a2(2013-03-11)\n-----------------\n\n* Added util method get_setting as default way to get a setting.\n\n\n0.1a1(2013-03-06)\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": "https://github.com/j23d/kotti_settings", "keywords": "kotti ui settings cms pyramid pylons", "license": "BSD-derived (http://www.repoze.org/LICENSE.txt)", "maintainer": null, "maintainer_email": null, "name": "kotti_settings", "package_url": "https://pypi.org/project/kotti_settings/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/kotti_settings/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/j23d/kotti_settings" }, "release_url": "https://pypi.org/project/kotti_settings/0.3/", "requires_dist": null, "requires_python": null, "summary": "Settings configuration for Kotti", "version": "0.3" }, "last_serial": 1982930, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "84e4a05f5cd811501fb84f6b7ce99137", "sha256": "aac411777ee25397600bc3c5a47214629a831bd48f3e96bb64d46ae8cb0f2566" }, "downloads": -1, "filename": "kotti_settings-0.1.zip", "has_sig": false, "md5_digest": "84e4a05f5cd811501fb84f6b7ce99137", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47617, "upload_time": "2013-10-19T22:49:25", "url": "https://files.pythonhosted.org/packages/74/b1/193885e4163c55a5b2ccfcd0ca312a57ba7b829d79f50fb959bf0ce34a03/kotti_settings-0.1.zip" } ], "0.1a1": [ { "comment_text": "", "digests": { "md5": "84b0c8ddf8b6eb570aae7923e69cdf77", "sha256": "44a0872be0a1d1b8337373cad7519c9f6722a853d6831c863359c6e094d0ab77" }, "downloads": -1, "filename": "kotti_settings-0.1a1.zip", "has_sig": false, "md5_digest": "84b0c8ddf8b6eb570aae7923e69cdf77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39147, "upload_time": "2013-03-06T09:15:40", "url": "https://files.pythonhosted.org/packages/fc/65/7ddc2a723d723a81a07cb7f432c692a1d07e0280809fe2918736eb8cd8a8/kotti_settings-0.1a1.zip" } ], "0.1a2": [ { "comment_text": "", "digests": { "md5": "29fe5b981cc524d864ba7cb8aaa11895", "sha256": "7757aa1f54991c175a0566bf3b2f646663dca26661c15f6b2195c4ccac8bc38c" }, "downloads": -1, "filename": "kotti_settings-0.1a2.zip", "has_sig": false, "md5_digest": "29fe5b981cc524d864ba7cb8aaa11895", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40127, "upload_time": "2013-03-11T21:23:09", "url": "https://files.pythonhosted.org/packages/48/56/04a95e5a3298b033bdb7450a1cb7386710da5a2c7b05e557b69f913bd5a9/kotti_settings-0.1a2.zip" } ], "0.1a3": [ { "comment_text": "", "digests": { "md5": "9382d17c8efeaabab701a8eb6b536a91", "sha256": "8b66da3fd4f95f4004456e927064a80d99b56dbcfa2ce32780841e3e7085b4cb" }, "downloads": -1, "filename": "kotti_settings-0.1a3.zip", "has_sig": false, "md5_digest": "9382d17c8efeaabab701a8eb6b536a91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40329, "upload_time": "2013-03-13T13:20:03", "url": "https://files.pythonhosted.org/packages/62/b4/9f12d6f39b504f60e8cfb5da53c4d205e8c998b89c7f62dedc8982808106/kotti_settings-0.1a3.zip" } ], "0.1b1": [ { "comment_text": "", "digests": { "md5": "475e20a9c278bd9d6d529a7162f3ab7b", "sha256": "984de87eaba0a42968c68248a4cade85a85cc87367e95f7cc4a254187e89aac0" }, "downloads": -1, "filename": "kotti_settings-0.1b1.zip", "has_sig": false, "md5_digest": "475e20a9c278bd9d6d529a7162f3ab7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44660, "upload_time": "2013-03-29T22:28:18", "url": "https://files.pythonhosted.org/packages/59/b0/357f69273fd45ce9dc68c3539e561aa34786882eeb9dedd27036ee88c0d9/kotti_settings-0.1b1.zip" } ], "0.1b2": [ { "comment_text": "", "digests": { "md5": "f7f5619a300fff626eea0c2d8deaa103", "sha256": "a6b054829377a605883df61c0e1f430782f9c781837ebf371031fde41b73ca8a" }, "downloads": -1, "filename": "kotti_settings-0.1b2.zip", "has_sig": false, "md5_digest": "f7f5619a300fff626eea0c2d8deaa103", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46500, "upload_time": "2013-04-18T08:22:55", "url": "https://files.pythonhosted.org/packages/d1/4b/11a2d961b562e769bb8728196faf851bb8d89ed7e4bf85a0b865012e263d/kotti_settings-0.1b2.zip" } ], "0.1b4": [ { "comment_text": "", "digests": { "md5": "bbcc4c7f14ec9fb91ae97479117c7b1c", "sha256": "11a238bccd9961691f2045c954a391dd411013f5a348f6d62d3a042760f833d7" }, "downloads": -1, "filename": "kotti_settings-0.1b4.zip", "has_sig": false, "md5_digest": "bbcc4c7f14ec9fb91ae97479117c7b1c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47857, "upload_time": "2013-05-02T15:55:01", "url": "https://files.pythonhosted.org/packages/55/cc/a405086803cdeb085e8330ae3c51f69a6634edc0babdff5fac17acc40daa/kotti_settings-0.1b4.zip" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "cecac1c6bd8f5416b3525e6edfcbb07e", "sha256": "d7bd07df3954cbc0ac418652109204cf631ff4a53bd4ea5c9dd842cc2a7f1572" }, "downloads": -1, "filename": "kotti_settings-0.2.zip", "has_sig": false, "md5_digest": "cecac1c6bd8f5416b3525e6edfcbb07e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47565, "upload_time": "2013-11-12T23:10:05", "url": "https://files.pythonhosted.org/packages/7a/28/1a27d9e1333480b1d17b31d9ef4dbec64286e589a1e651a7500ef72cbb54/kotti_settings-0.2.zip" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "1f92ded9f1854e802c5db6185d1be97f", "sha256": "6087bfc203b6389de94c6b74e48415b0c0eb16d7f53221e2e0821f6650cc718e" }, "downloads": -1, "filename": "kotti_settings-0.3.zip", "has_sig": false, "md5_digest": "1f92ded9f1854e802c5db6185d1be97f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39550, "upload_time": "2016-02-29T22:00:22", "url": "https://files.pythonhosted.org/packages/ca/bc/624582af00bdc1bd6b31b23248711fa610d7bea0b11fbfd04dca3818de38/kotti_settings-0.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1f92ded9f1854e802c5db6185d1be97f", "sha256": "6087bfc203b6389de94c6b74e48415b0c0eb16d7f53221e2e0821f6650cc718e" }, "downloads": -1, "filename": "kotti_settings-0.3.zip", "has_sig": false, "md5_digest": "1f92ded9f1854e802c5db6185d1be97f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39550, "upload_time": "2016-02-29T22:00:22", "url": "https://files.pythonhosted.org/packages/ca/bc/624582af00bdc1bd6b31b23248711fa610d7bea0b11fbfd04dca3818de38/kotti_settings-0.3.zip" } ] }