{ "info": { "author": "Springload", "author_email": "hello@springload.co.nz", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Internet :: WWW/HTTP :: Site Management", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Editors :: Word Processors" ], "description": "wagtailmodelchoosers\n====================\n\n A Wagtail app to pick generic models (rather than snippets or pages).\n\n**This is alpha software, use at your own risk. Do not use in production (yet).**\n\nCheck out `Awesome Wagtail `_ for more awesome packages and resources from the Wagtail community.\n\n.. image:: https://cdn.rawgit.com/springload/wagtailmodelchoosers/b7b6202/.github/wagtailmodelchoosers-screenshot.png\n :width: 728 px\n\nInstallation\n------------\n\nGrab the package from pip with ``pip install wagtailmodelchoosers``, then add ``wagtailmodelchoosers`` in ``INSTALLED_APPS`` in your settings.\n\nUsage\n-----\n\n``ModelChooserBlock`` takes the name of the chooser configuration as first positional argument. Use other block kwargs (e.g. `required`) as usual.\n\n.. code:: python\n\n from wagtail.wagtailcore import blocks\n from wagtailmodelchoosers.blocks import ModelChooserBlock\n \n class CustomBlock(blocks.StructBlock):\n custom_model = ModelChooserBlock('custom_model') # `chooser` can be a positional argument, the keyword is used here for clarity.\n \n``ModelChooserPanel`` takes the name of the field as first positional argument (like a regular Panel) and the name of the chooser configuration as second positional argument. Use other panel kwargs as usual.\n\n.. code:: python\n\n from django.db import models\n from wagtail.core.models import Page\n from wagtailmodelchoosers.edit_handlers import ModelChooserPanel\n \n class CustomPage(Page):\n custom_model = models.ForeignKey('myapp.CustomModel')\n \n panels = [\n ...\n ModelChooserPanel('custom_model', chooser='custom_model'), # `chooser` can be a positional argument, the keyword is used here for clarity.\n ]\n\nTo select a model from a remote API, respectively use ``RemoteModelChooserBlock`` and ``RemoteModelChooserPanel`` instead.\n\nIf you have `WagtailDraftail `_ installed, it will automatically register the ``ModelSource`` and ``RemoteModelSource`` to the JS. Refer to ``WagtailDraftail``'s `documentation `_ to hook it up properly.\n\nConfiguration\n~~~~~~~~~~~~~\n\nIt looks for a ``MODEL_CHOOSERS_OPTIONS`` dictionary in the settings where the key is the name of the chooser and the value, a dictionary of options.\n\nThe ModelChooser and RemoteModelChooser share a similar base configuration and only have a few specific fields.\n\n.. code:: python\n\n MODEL_CHOOSERS_OPTIONS = {\n 'navigation': {\n 'label': 'Navigation', # The label to use for buttons or modal title\n 'display': 'name', # The field to display when selecting an object\n 'list_display': [ # The fields to display in the chooser\n {'label': 'Name', 'name': 'name'},\n {'label': 'Identity', 'name': 'identity'},\n {'label': 'Active', 'name': 'active'},\n ],\n 'content_type': 'core.Navigation', # ONLY FOR MODEL: The django content type of the model\n 'fields_to_save': ['id'] + RATE_CHOOSER_DISPLAY_FIELDS, # ONLY FOR REMOTE: The remote objects fields to save to the DB. Leave empty to save the whole object.\n 'remote_endpoint': 'http://...' # ONLY FOR REMOTE: The remote API endpoint.\n 'pk_name': 'uuid', # The primary key name of the model\n }\n }\n \nIn addition, you can customise the mapping of the key of the API, see the configuration key names being used for the `query `_ and the `response `_.\n\n\nDevelopment\n-----------\n\nInstallation\n~~~~~~~~~~~~\n\nRequirements: ``virtualenv``, ``pyenv``, ``twine``\n\n.. code:: sh\n\n git clone git@github.com:springload/wagtailmodelchoosers.git\n cd wagtailmodelchoosers/\n virtualenv .venv\n source ./.venv/bin/activate\n pip install -e .[testing,docs] -U\n nvm install\n npm install\n\nCommands\n~~~~~~~~\n\n.. code:: sh\n\n make help # See what commands are available.\n\nTODO: Complete\n\nReleases\n~~~~~~~~\n\n* Make a new branch for the release of the new version.\n* Update the `CHANGELOG `_.\n* Update the version number in ``wagtailmodelchoosers/__init__.py`` and ``package.json``, following semver.\n* Make a PR and squash merge it.\n* Back on master with the PR merged, use ``make publish`` (confirm, and enter your password).\n* Finally, go to GitHub and create a release and a tag for the new version.\n* Done!", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/springload/wagtailmodelchoosers", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "wagtailmodelchoosers", "package_url": "https://pypi.org/project/wagtailmodelchoosers/", "platform": "", "project_url": "https://pypi.org/project/wagtailmodelchoosers/", "project_urls": { "Homepage": "https://github.com/springload/wagtailmodelchoosers" }, "release_url": "https://pypi.org/project/wagtailmodelchoosers/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "A Wagtail app to pick generic models (rather than snippets or pages)", "version": "0.1.2" }, "last_serial": 5101344, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "30f4c5e813c7226c650fa6650499b0ad", "sha256": "fa118aaa04f1767c9f11a237e9432d24eb9f27b97d8f51a1cb60983fd4d06e84" }, "downloads": -1, "filename": "wagtailmodelchoosers-0.1.0.tar.gz", "has_sig": false, "md5_digest": "30f4c5e813c7226c650fa6650499b0ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 276865, "upload_time": "2017-04-30T06:39:11", "url": "https://files.pythonhosted.org/packages/81/3c/8e4e1e17b0febb4d9930d9d38e1a3ff9f8390da850548b121bbf3f876c88/wagtailmodelchoosers-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f645c57d5b302310dc35b324acb36cf5", "sha256": "88497185cbb30359c75e4339aecd95ddc010cec773fbb16f9c3344193e22afb4" }, "downloads": -1, "filename": "wagtailmodelchoosers-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f645c57d5b302310dc35b324acb36cf5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 285569, "upload_time": "2017-07-13T10:13:40", "url": "https://files.pythonhosted.org/packages/e0/f5/b3ec3f68dbfad2f954494eed012696aa1e24c0f964aca7cec265a890502a/wagtailmodelchoosers-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "e3e6a6a773b1f7d2c8e7745a5f14c1bb", "sha256": "66d855ae141d3c0c2d88812e1c4623f68d8bd6f16455e2a51d86d859125bdbbb" }, "downloads": -1, "filename": "wagtailmodelchoosers-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e3e6a6a773b1f7d2c8e7745a5f14c1bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 285648, "upload_time": "2017-08-22T03:22:33", "url": "https://files.pythonhosted.org/packages/c3/7f/bd96578d7cc369e16581afaf9a1a7f6cb2c7fde383b3720c1bec48370587/wagtailmodelchoosers-0.1.2.tar.gz" } ], "2.0b1": [ { "comment_text": "", "digests": { "md5": "4bfe7a594f0986db881a4cf798862663", "sha256": "f9abe9f4bb5b584a9839edc79cfbe2a4b04db239f2a6e83c97482e6bc45b3a3f" }, "downloads": -1, "filename": "wagtailmodelchoosers-2.0b1.tar.gz", "has_sig": false, "md5_digest": "4bfe7a594f0986db881a4cf798862663", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 147149, "upload_time": "2019-04-04T23:20:01", "url": "https://files.pythonhosted.org/packages/30/0a/e784bd09c307354e964e30024370f472b6e59f11f42f16fc08c9a33ed621/wagtailmodelchoosers-2.0b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e3e6a6a773b1f7d2c8e7745a5f14c1bb", "sha256": "66d855ae141d3c0c2d88812e1c4623f68d8bd6f16455e2a51d86d859125bdbbb" }, "downloads": -1, "filename": "wagtailmodelchoosers-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e3e6a6a773b1f7d2c8e7745a5f14c1bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 285648, "upload_time": "2017-08-22T03:22:33", "url": "https://files.pythonhosted.org/packages/c3/7f/bd96578d7cc369e16581afaf9a1a7f6cb2c7fde383b3720c1bec48370587/wagtailmodelchoosers-0.1.2.tar.gz" } ] }