{ "info": { "author": "isik-kaplan", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "[![Build Status](https://travis-ci.org/isik-kaplan/django_ief.svg?branch=master)](https://travis-ci.org/isik-kaplan/django_ief)\n[![PyPI - License](https://img.shields.io/pypi/l/django-ief.svg)](https://pypi.org/project/django-ief/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/django-ief.svg)](https://pypi.org/project/django-ief/)\n \n## What is *django_ief*?\n\nIt is a field for django database models which you don't need any extra forms to edit nor save.\n\n## How to use it?\n\nFirst, install the application and add the urls.\n\n```python \n# settings.py \n\ninstalled_apps = [\n ...,\n 'django_ief',\n ...,\n]\n\n# urls.py\n\nurlpatterns = [\n path('', include('django_ief.urls')),\n # others\n]\n\n```\n\nThen just use it as a field.\n\n```python \nfrom django.db import models\nfrom django_ief.fields import InlineEditableField\n\ndef permission_function(request):\n return get_perm_from_request(request)\n\nclass BlogPost(models.Model):\n content = InlineEditableField(\n can_edit=permission_function,\n text_field_kwargs={**kwargs_for_text_field},\n image_field_kwargs={**kwargs_for_image_field}\n )\n```\n\nThe above creates an additional model to hold its images which looks like this:\n\n```python \nclass BlogPost_Images(models.Model):\n owner = models.ForeignKey(BlogPost, on_delete=models.CASCADE)\n image = models.ImageField(**kwargs_for_image_field)\n```\nwhich you can access with\n```python \nBlogPost.image_model\n```\n\nand creates a text field in the original model which looks like: \n\n```python \nclass BlogPost(models.Model):\n content = InlineEditableField(...)\n content_text = models.TextField(**kwargs_for_text_field)\n```\n\nIf you want you may interact with those underlying fields and models but you don't need to,\nall you need to do is to use one attribute of the `InlineEditableField` in your templates, `rendered`. \n\n```html \n \n \n\n \n{{ obj.content.rendered }}\n```\nAnd that's it, everything else is automatically taken care of.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/isik-kaplan/django_ief", "keywords": "", "license": "APGL-3.0", "maintainer": "", "maintainer_email": "", "name": "django-ief", "package_url": "https://pypi.org/project/django-ief/", "platform": "", "project_url": "https://pypi.org/project/django-ief/", "project_urls": { "Homepage": "https://github.com/isik-kaplan/django_ief" }, "release_url": "https://pypi.org/project/django-ief/0.1.1/", "requires_dist": null, "requires_python": ">=3.5", "summary": "A model field that can be edited without needing a form.", "version": "0.1.1" }, "last_serial": 5800744, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "853b1ff0fea322c3adc925607eaded93", "sha256": "2dac3203cbd87d88fc529aa2add6e8f7019b20e374d2c8cbf800d4fb82ab8016" }, "downloads": -1, "filename": "django_ief-0.1.0.tar.gz", "has_sig": false, "md5_digest": "853b1ff0fea322c3adc925607eaded93", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 148390, "upload_time": "2019-08-25T18:42:47", "url": "https://files.pythonhosted.org/packages/27/2a/b9f8b877c75b4742a1fc4e16199bf875cae41d04210506411f08ab76c102/django_ief-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "3825df4ee2185a5bdc3eec729fa0587e", "sha256": "19e73d1e9ce8bfea043c3f2ecfb7d780e75696cfb792839db0e35bcbd3a88438" }, "downloads": -1, "filename": "django_ief-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3825df4ee2185a5bdc3eec729fa0587e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 149408, "upload_time": "2019-09-08T21:26:38", "url": "https://files.pythonhosted.org/packages/51/30/ca0a9dc092133726e1ffc58350732c767477ab9ca573b6e2b34b9ed03fbd/django_ief-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3825df4ee2185a5bdc3eec729fa0587e", "sha256": "19e73d1e9ce8bfea043c3f2ecfb7d780e75696cfb792839db0e35bcbd3a88438" }, "downloads": -1, "filename": "django_ief-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3825df4ee2185a5bdc3eec729fa0587e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 149408, "upload_time": "2019-09-08T21:26:38", "url": "https://files.pythonhosted.org/packages/51/30/ca0a9dc092133726e1ffc58350732c767477ab9ca573b6e2b34b9ed03fbd/django_ief-0.1.1.tar.gz" } ] }