{ "info": { "author": "Raphael Kimmig", "author_email": "raphael@ampad.de", "bugtrack_url": null, "classifiers": [ "Framework :: Django", "Programming Language :: Python :: 3" ], "description": "[![CircleCI](https://circleci.com/gh/django-beam/django-beam.svg?style=svg)](https://circleci.com/gh/django-beam/django-beam)\n[![ReadTheDocs](https://readthedocs.org/projects/django-beam/badge/)](https://django-beam.readthedocs.io/en/latest/)\n\n# django-beam\n\ndjango-beam provides you with a set of views, templates and integrations for the most common CRUD\napplications.\n\nThe goal is having the functionality provided by django's own admin, but in a way that integrates with your other frontend code.\n\n## This project is still in early development. \nMost of the core concepts have stabilized and it is being used in production. However there may\nstill be breaking changes gonig forward\n\n## Features\n- CRUD operations based on class based views\n- Easily extensible\n- Extensions for common use cases and popular third party packages\n\n## Documentation\nShould end up at https://django-beam.readthedocs.io/en/latest/\n\n## Example\n```\n # people/models.py\n class Group(models.Model):\n name = models.TextField()\n\n\n class Person(models.Model):\n name = models.TextField()\n email = models.EmailField()\n\n groups = models.ManyToManyField(Group)\n\n\n # people/views.py\n import beam\n\n class PersonViewSet(beam.ViewSet):\n fields = ['name', 'groups']\n\n\n class GroupViewSet(beam.ViewSet):\n fields = ['name']\n\n\n # urls.py\n urlpatterns += [\n path('person/', include(PersonViewSet().get_urls())),\n path('group/', include(GroupViewSet().get_urls())),\n ]\n\n\n # settings.py\n INSTALLED_APPS += [\n \"beam\",\n \"beam.themes.bootstrap4\", # or choose any theme you like\n ]\n```\n\n## Core concepts\nThere are a few pieces beyond standard django that you need to understand to use beams.\nThe first one are **ViewSets**. They are used to group and configure several views for a single model (similar to\n`django-rest-framework`). Specifying e.g. `fields = [\"name\", \"age\"]` will pass those fields to all views for the specified model. They also allow you to specify and override configuration for single views, by setting e.g. `update_fields = [\"name\"]` the update view will be restricted to just the name.\n\nThe next concept are **Components**. Components are used to group and pass relevant attributes from\nthe viewset to the individual views. A view is only passed data that it's component expects in \n`__init__`. \n\nThe viewset figures out which attributes should be passed to a component and also takes into account\nthe specificiy. If you specify both `fields` and `detail_fields`, the detail component will receive\nthe latter, while all other components will be passed the former.\n\n### Example of using a custom component \nBelow you can see an example of adding a custom view \n```\nclass CustomerCallView(beam.views.ComponentMixin, MyBaseView):\n phone = None\n # your custom view code goes here ...\n\nclass CustomerViewSet(beam.ViewSet):\n model = Customer\n fields = [\"first_name\", \"last_name\", \"email\", \"phone\"]\n\n call_component = Component\n call_url = \"call/{phone}/\"\n call_url_kwargs = [\"phone\"]\n```\n\n## Layouts\n\n### Form layouts\nBeam layouts are a simple way to give forms and detail views \nsome structure without the use of custom templates.\nBy specifying a tripple nested list on the viewset, fields can be grouped into \nrows and columns. The default theme supports up to 4 columns per row.\n\n```\nlayout = [\n [ # first row\n [\"name\", \"age\",], # first column\n [\"phone\", \"email\",], # second column\n ]\n [ # second row\n [\"a\", \"b\",], # first column\n [\"c\", \"d\",], # second column\n ]\n]\n```\n\nFIXME IMAGE\n\n### Link layouts\nBeam shows links to other views in the viewset both at the top of all pages\nas well as next to items in the list page.\nIn order to specify which links should be visible at the top of the detail page,\nyou can e.g. specify `detail_links = [\"update\", \"...\", \"delete\", \"!create\"]`.\nThis would cause create to be hidden, the first link to be to the update view, the last one to\nthe delete view and all other components would show up in between those two.\n\nIf you e.g. want the create view to be the only one shown at the top of the list view, set\n`list_links = [\"create\"]`. To specify the links shown next to list items, set `list_item_links`.\n\n## Inlines\n\n```\nclass ContactDataInline(beam.RelatedInline):\n fields = [\"medium\", \"value\"]\n fk_field_name = 'person'\n\n\nclass PersonViewSet(beam.ViewSet):\n create_inline_viewset_classes = []\n inline_viewset_classes = [ContactDataInline]\n\n```\n\n\n## Themes\nWe currently ship only one theme.\n* `beam.themes.bootstrap4`\n Using default Bootstrap v4 markup and include a basic Bootstrap CSS file.\n\n In order to use the bootstrap4 theme you have to install the optional dependency\n `django-crispy-forms` and add it to your `INSTALLED_APPS` in settings.py:\n ```\n INSTALLED_APPS = (..., 'crispy_forms')\n ```\n\n\n## beam.contrib\n\nWe include a `beam.contrib` package that provides integration with several third party django apps.\n\n### beam.contrib.reversion\n\nProvides a base viewset for integration with `django-reversion`.\n\n#### Usage\nFirst add `reversion` and `beam.contrib.reversion` to your installed apps.\nEither use `beam.contrib.reversion.VersionViewSet` as the base class for the \nmodels where you want reversion or use the `VersionViewSetMixin`.\n\nBy default create and update views are tracked. You can use the `versioned_component_names` \nclass attribute to control which components are tracked.\n\nIf you do not manually register your models with reversion then `VersionViewSet.model` is registered\nfollowing all the inlines specified for the `versioned_component_names`.\n\n### beam.contrib.autocomplete\\_light\n\nProvides a viewset mixin for integration with `django-autocomplete-light`.\nIt also provides some bootstrap compatible css to override django-autocomplete-light defaults. To use those\nyou'll have to add `beam.contrib.autocomplete_light` to your installed apps *before* `django-autocomplete-light`.\n\n#### Usage\n\nAdd the mixin to your viewset, then use `django-autocomplete-light` as per the projects docs, for\nexample by overriding the widget dicts.\n\n```python\n# settings.py\nINSTALLED_APPS = [\n \"dal\",\n \"beam.contrib.autocomplete_light\",\n \"dal_select2\",\n ...\n]\n\n# views.py\nimport beam\nfrom beam.contrib.autocomplete_light import AutocompleteMixin\n\nclass GroupViewSet(AutocompleteMixin, beam.ViewSet):\n fields = ['name']\n autocomplete_search_fields = [\"name\"]\n\n# forms.py\nfrom django import forms\nfrom people.models import Person\n\nfrom dal_select2.widgets import ModelSelect2Multiple\n\nclass PersonForm(forms.ModelForm):\n class Meta:\n model = Person\n fields = [\"name\", \"email\", \"groups\"]\n widgets = {\n \"groups\": ModelSelect2Multiple(\n url=\"people_group_autocomplete\"\n ),\n }\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/django-beam/django-beam/archive/0.9.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/django-beam/django-beam", "keywords": "", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "django-beam", "package_url": "https://pypi.org/project/django-beam/", "platform": "", "project_url": "https://pypi.org/project/django-beam/", "project_urls": { "Download": "https://github.com/django-beam/django-beam/archive/0.9.1.tar.gz", "Homepage": "https://github.com/django-beam/django-beam" }, "release_url": "https://pypi.org/project/django-beam/0.9.1/", "requires_dist": null, "requires_python": "", "summary": "A crud library for python", "version": "0.9.1" }, "last_serial": 5619304, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "7dbd3b9ab78c4c1625c3da46e285d742", "sha256": "dfb62c9e4a6b8644b1d49244db3e48ae0fa9c93610082889db36636ffc089662" }, "downloads": -1, "filename": "django-beam-0.0.1.tar.gz", "has_sig": false, "md5_digest": "7dbd3b9ab78c4c1625c3da46e285d742", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 919, "upload_time": "2018-05-26T09:04:09", "url": "https://files.pythonhosted.org/packages/89/79/6ac0f958ac72a7ce59f51a70f47509434aebd4b7758f0a66ea2191f89e11/django-beam-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "a0c4f02e4cd9c48ed405511927297f72", "sha256": "f49dea7855e3a1a735af5136c43cc4aa1e28ac90ef69531e27ad2618e63f2a33" }, "downloads": -1, "filename": "django-beam-0.0.2.tar.gz", "has_sig": false, "md5_digest": "a0c4f02e4cd9c48ed405511927297f72", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 913, "upload_time": "2018-05-26T09:09:12", "url": "https://files.pythonhosted.org/packages/2a/30/97396cc39b9f9d4b0eaf56d15af1e4b0fe177d1f246ed33fe4b91ff2e03e/django-beam-0.0.2.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "7ee4a6e4d7da0ef365f34e226c431742", "sha256": "5dec3ae78cda56192f225a999f53e7d43eacfad1daeee33957ee1afa53158e63" }, "downloads": -1, "filename": "django_beam-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "7ee4a6e4d7da0ef365f34e226c431742", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13633, "upload_time": "2018-05-29T16:13:14", "url": "https://files.pythonhosted.org/packages/92/b3/87944c2690c01fd8ccfea496bda08d88fb5f575648849cc46497965247fb/django_beam-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b35daf55db2d172cee664a90e7400593", "sha256": "6a388fb484daa6d8428b7aa52bdec8d52abe052cadd347bdd3effd00265764a0" }, "downloads": -1, "filename": "django-beam-0.0.4.tar.gz", "has_sig": false, "md5_digest": "b35daf55db2d172cee664a90e7400593", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9734, "upload_time": "2018-05-29T16:13:15", "url": "https://files.pythonhosted.org/packages/07/28/3b23040390481e03da3b944d61742c7d4bbd07dd24ed95a14afd63687ea8/django-beam-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "8123cc1d54d8b1e6ded7ab3c2cc44be1", "sha256": "e0a24a86e5d49027ad89d1e078aa1ce0e0ad4e13366334fea7ed656f98adcab9" }, "downloads": -1, "filename": "django_beam-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "8123cc1d54d8b1e6ded7ab3c2cc44be1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12888, "upload_time": "2018-05-29T16:16:33", "url": "https://files.pythonhosted.org/packages/fb/9d/bfca306c87cf71eb44cfd4e876b344a1dcfcab683535fd31c2957b1dbc59/django_beam-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97a5df08c5343180f93f59947f9507f9", "sha256": "bdb77e245f1a875d4bb9f17ee939b5bda5f667968ad5800c5bbc26c19a821d80" }, "downloads": -1, "filename": "django-beam-0.0.5.tar.gz", "has_sig": false, "md5_digest": "97a5df08c5343180f93f59947f9507f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8069, "upload_time": "2018-05-29T16:16:34", "url": "https://files.pythonhosted.org/packages/f7/f7/e08d53673acdca9c271839728f5da213c2258ef735382a0945a99437900d/django-beam-0.0.5.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "c2cce600f55cd3c311eb311c16e2f479", "sha256": "74d78f92920b0899cfbc40c72d23963ebbf098763f3d302b91357119411dcb7a" }, "downloads": -1, "filename": "django-beam-0.9.0.tar.gz", "has_sig": false, "md5_digest": "c2cce600f55cd3c311eb311c16e2f479", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34752, "upload_time": "2019-07-04T06:58:24", "url": "https://files.pythonhosted.org/packages/05/8b/c05619236195680a37f5e91878f36ef3eefcbff36d7ef5644e9202d60085/django-beam-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "bacbdedba61f81fcaae4c49ece2b08f4", "sha256": "2f396f382d5d88f89f7deb20e8e94d1d50ec7c4aa6cf35bea16bafc9642a379e" }, "downloads": -1, "filename": "django-beam-0.9.1.tar.gz", "has_sig": false, "md5_digest": "bacbdedba61f81fcaae4c49ece2b08f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32466, "upload_time": "2019-08-01T15:07:34", "url": "https://files.pythonhosted.org/packages/49/db/170f9d595c545027ff1ee2b90e4c6333a81a48c6459d18d0a7c3832cabca/django-beam-0.9.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bacbdedba61f81fcaae4c49ece2b08f4", "sha256": "2f396f382d5d88f89f7deb20e8e94d1d50ec7c4aa6cf35bea16bafc9642a379e" }, "downloads": -1, "filename": "django-beam-0.9.1.tar.gz", "has_sig": false, "md5_digest": "bacbdedba61f81fcaae4c49ece2b08f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32466, "upload_time": "2019-08-01T15:07:34", "url": "https://files.pythonhosted.org/packages/49/db/170f9d595c545027ff1ee2b90e4c6333a81a48c6459d18d0a7c3832cabca/django-beam-0.9.1.tar.gz" } ] }