{ "info": { "author": "Jatinderjit Singh", "author_email": "jatinderjit89@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Django", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8" ], "description": "# Create JSON Indexes concurrently\n\nThe functionality provided by this Django App is similar to the\n[indexes](https://docs.djangoproject.com/en/2.2/ref/models/options/#django.db.models.Options.indexes),\nexcept that it provides an option to create indexes\n[concurrently](https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY).\n\nCurrently, only Postgres JSON Indexes are supported.\n\n## Installation\nInstall the latest version using pip:\n```bash\npip install django_indices\n```\n\nAdd `django_indices` to `INSTALLED_APPS` in the django settings file:\n```python\nINSTALLED_APPS = (\n ...,\n \"django_indices\",\n)\n```\n\nRun the migrations:\n```bash\npython manage.py migrate django_indices\n```\n\nAdd the indices you want to the `Meta` class of the required Model. Then run\nthe `migrate_indices` management command to add / remove the indices:\n```bash\npython manage.py migrate_indices\n```\n\n\n## Example\n```python\nfrom django.db import models\nfrom django.db.models import Q\nfrom django.contrib.postgres.fields import JSONField\n\nfrom django_indices import JSONIndex\n\nclass Inventory(models.Model):\n data = JSONField()\n\n class Meta:\n indices = [\n # Creates an index on data->'product_type'\n # Indexes are created concurrently by default, which doesn't lock\n # the table.\n JSONIndex(\n field=[\"data\", \"product_type\"],\n name=\"idx_inventory_product_type\",\n ),\n\n # Creates a unique index on data->'product'->>'id'\n #\n # concurrently=False ensures that the index creation will execute\n # in a transaction. So the index is either created successfully,\n # or fails cleanly. This will lock the table though.\n JSONIndex(\n field=[\"data\", \"product\", \"id\"],\n name=\"idx_inventory_product_id\",\n unique=True,\n concurrently=False,\n ),\n\n # Creates a partial compound index on\n # (data->'product'->>'brand', data->'product'->>'size')\n # WHERE data->>'product_type' = 'shoe' OR data->>'product_type' = 'crocs'\n JSONIndex(\n field=([\"data\", \"product\", \"brand\"], [\"data\", \"product\", \"size\"]),\n name=\"idx_inventory_footwear_brand_size\",\n where=(Q(data__product_type=\"shoe\") | Q(data__product_type=\"crocs\"),\n ),\n\n ]\n```\n\n\n", "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/jatinderjit/django-indices", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-indices", "package_url": "https://pypi.org/project/django-indices/", "platform": "", "project_url": "https://pypi.org/project/django-indices/", "project_urls": { "Homepage": "https://github.com/jatinderjit/django-indices" }, "release_url": "https://pypi.org/project/django-indices/0.0.4.post2/", "requires_dist": null, "requires_python": "", "summary": "Create JSON indexes concurrently", "version": "0.0.4.post2" }, "last_serial": 5798617, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "78e3850071da5f0d5a1b507ba58b3974", "sha256": "6dd16dd20ffe62a6cfb6e7ebf263f3c2fac5e1008af774440108aeeeed67dc31" }, "downloads": -1, "filename": "django_indices-0.0.1--py3-none-any.whl", "has_sig": false, "md5_digest": "78e3850071da5f0d5a1b507ba58b3974", "packagetype": "bdist_wheel", "python_version": "-py3", "requires_python": null, "size": 7429, "upload_time": "2019-08-05T19:31:10", "url": "https://files.pythonhosted.org/packages/02/74/f833391b3378f12afeadaf041a248c0fa1f3789fe99e0c675d315fd67675/django_indices-0.0.1--py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b64e9cc37ee7673c4c569c4dadc14c52", "sha256": "9b85072cc0883bc26ed2255bc5cd19ba0020a092a54d4cf3bf7ed9d611d17268" }, "downloads": -1, "filename": "django-indices--0.0.1.tar.gz", "has_sig": false, "md5_digest": "b64e9cc37ee7673c4c569c4dadc14c52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4146, "upload_time": "2019-08-05T19:31:11", "url": "https://files.pythonhosted.org/packages/5d/83/672144d91a27de23bc31c31ad708149b3c34502a17461e20b6a1743c3885/django-indices--0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "9061724f4a02fb657ebad8b8c2f45463", "sha256": "f9bf6953650697685bd26fbcf52446875cd6472afca4f871eac6560be04fec3b" }, "downloads": -1, "filename": "django_indices-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9061724f4a02fb657ebad8b8c2f45463", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7431, "upload_time": "2019-08-05T19:43:15", "url": "https://files.pythonhosted.org/packages/02/cd/c4d74f536604632f13bf4295eb4645953e7060ef7f2a1435f93b18169f7d/django_indices-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf361c637f6f59548480201691bf7a9c", "sha256": "40e6ade8a4f36921ed96ceea71c4b50ce42fd904aa8cd1a3953ced23a47402f2" }, "downloads": -1, "filename": "django-indices-0.0.2.tar.gz", "has_sig": false, "md5_digest": "cf361c637f6f59548480201691bf7a9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4150, "upload_time": "2019-08-05T19:43:17", "url": "https://files.pythonhosted.org/packages/d8/ab/ef41fc5053a289c8e503bdeaa9290790a9e324666df409c73c666b9aea60/django-indices-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "2c214aef576cdcd2c146432bd5a8c1cc", "sha256": "06885c6142c0c2ecec01ba6951c05ae0616e8f5b17c2dabc834ba8697689ce19" }, "downloads": -1, "filename": "django_indices-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "2c214aef576cdcd2c146432bd5a8c1cc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8273, "upload_time": "2019-08-06T11:15:38", "url": "https://files.pythonhosted.org/packages/ff/72/742e4377aa522e503f90dde2de1c5f7c1f0a28a510c52496e7eae0567b5e/django_indices-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b09637092a6f96c7a9be95ea39cc5985", "sha256": "fdb23dc3f25b667bfa4b5477e883dfdb3b0d9ee26d306ff30a38d7a8959a6d41" }, "downloads": -1, "filename": "django-indices-0.0.3.tar.gz", "has_sig": false, "md5_digest": "b09637092a6f96c7a9be95ea39cc5985", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4519, "upload_time": "2019-08-06T11:15:39", "url": "https://files.pythonhosted.org/packages/1d/4e/de40db3d98877b00419250ee334670010b7d89b311baa8c254844f00466f/django-indices-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "4052039f98bd2639ed13b196f1ecc8ed", "sha256": "0eb7b8c382558b209565514fbf5fd81b873b0e687bf518090d542042ff9eaceb" }, "downloads": -1, "filename": "django_indices-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "4052039f98bd2639ed13b196f1ecc8ed", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8269, "upload_time": "2019-08-06T11:27:23", "url": "https://files.pythonhosted.org/packages/fe/67/55ff30524aad11f47a4f4cbbdd909783177032b67f4aedb5d55037389060/django_indices-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6e2c3f2407b61a1ce9dcfdf438d9b126", "sha256": "514415f57452762027ce985729e6abbe032e46f5db723de985d185271baa486b" }, "downloads": -1, "filename": "django-indices-0.0.4.tar.gz", "has_sig": false, "md5_digest": "6e2c3f2407b61a1ce9dcfdf438d9b126", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4519, "upload_time": "2019-08-06T11:27:25", "url": "https://files.pythonhosted.org/packages/47/e4/d6e40592a73fff572000cd973e10a17294e4ad47acc69ca6bc7e1648936f/django-indices-0.0.4.tar.gz" } ], "0.0.4.post1": [ { "comment_text": "", "digests": { "md5": "64ee0d785f0484ab1b5a38af7efdb8bd", "sha256": "6d8f995623288b483dc29b0c65ef7f4998b3cbb5a5b0b29d9e83aebca95e2ff6" }, "downloads": -1, "filename": "django_indices-0.0.4.post1-py3-none-any.whl", "has_sig": false, "md5_digest": "64ee0d785f0484ab1b5a38af7efdb8bd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8605, "upload_time": "2019-08-07T04:59:26", "url": "https://files.pythonhosted.org/packages/8c/77/84f81d7789191cb80da5742ad39e7f787e22bc10a7f9b455279941f92b53/django_indices-0.0.4.post1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3fa313bf2cac6d40e92ba7676031eb90", "sha256": "1d8773d1e1ba915d5372c72c5b9957d4659f2b71dc8d24fa69c8db654c977da5" }, "downloads": -1, "filename": "django-indices-0.0.4.post1.tar.gz", "has_sig": false, "md5_digest": "3fa313bf2cac6d40e92ba7676031eb90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4843, "upload_time": "2019-08-07T04:59:27", "url": "https://files.pythonhosted.org/packages/2a/c6/b6281c6f1243c2f5ff57a3b20a0f7f42d915ec82b625e516e03c63db44ef/django-indices-0.0.4.post1.tar.gz" } ], "0.0.4.post2": [ { "comment_text": "", "digests": { "md5": "a06d2c24949602b95533f5e58c211702", "sha256": "491a4be89d32699c60b2d4d0f03251caa47b156f932a70a9afe6bf648b48a751" }, "downloads": -1, "filename": "django_indices-0.0.4.post2-py3-none-any.whl", "has_sig": false, "md5_digest": "a06d2c24949602b95533f5e58c211702", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8606, "upload_time": "2019-09-08T07:27:21", "url": "https://files.pythonhosted.org/packages/b6/68/4863cda15edb71c402f5723cb385543d8c3f6de85c525b69ebd1db3d5cbf/django_indices-0.0.4.post2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d6c807537b0249148cdcb3aa97371ac", "sha256": "2b9b044f8de45c56a768291e85fa5eedb7757d319f16f7da9437da0763f52d16" }, "downloads": -1, "filename": "django-indices-0.0.4.post2.tar.gz", "has_sig": false, "md5_digest": "1d6c807537b0249148cdcb3aa97371ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4850, "upload_time": "2019-09-08T07:27:23", "url": "https://files.pythonhosted.org/packages/14/a5/c46b16138b9856526861bd5fa27f5629256bc073c00913d3eee39c020051/django-indices-0.0.4.post2.tar.gz" } ], "0.0.post1": [ { "comment_text": "", "digests": { "md5": "3b716bb1226e6735ee1faedaa5715414", "sha256": "ba7ba285b1d077b1e1019a72f8d587b290b0c26a934b7855deccc9bfe9ab1202" }, "downloads": -1, "filename": "django_indices-0.0.post1-py3-none-any.whl", "has_sig": false, "md5_digest": "3b716bb1226e6735ee1faedaa5715414", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7475, "upload_time": "2019-08-05T19:32:27", "url": "https://files.pythonhosted.org/packages/13/5d/3a761c97b1352526f041add2fd3341f66170f9392a8f99ea9855a3c7726b/django_indices-0.0.post1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4f2fb20aaecd00062720ac28ea952e15", "sha256": "f819727dc864120d460e321f758438a5d329a60d4dd2dbdbf2a2866e88be5fa3" }, "downloads": -1, "filename": "django-indices-0.0.post1.tar.gz", "has_sig": false, "md5_digest": "4f2fb20aaecd00062720ac28ea952e15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4163, "upload_time": "2019-08-05T19:32:29", "url": "https://files.pythonhosted.org/packages/b2/d1/00e11aed3b1af80880fb741377771c3a8aa1a6d6bc085437b4663b1cef9d/django-indices-0.0.post1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a06d2c24949602b95533f5e58c211702", "sha256": "491a4be89d32699c60b2d4d0f03251caa47b156f932a70a9afe6bf648b48a751" }, "downloads": -1, "filename": "django_indices-0.0.4.post2-py3-none-any.whl", "has_sig": false, "md5_digest": "a06d2c24949602b95533f5e58c211702", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8606, "upload_time": "2019-09-08T07:27:21", "url": "https://files.pythonhosted.org/packages/b6/68/4863cda15edb71c402f5723cb385543d8c3f6de85c525b69ebd1db3d5cbf/django_indices-0.0.4.post2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d6c807537b0249148cdcb3aa97371ac", "sha256": "2b9b044f8de45c56a768291e85fa5eedb7757d319f16f7da9437da0763f52d16" }, "downloads": -1, "filename": "django-indices-0.0.4.post2.tar.gz", "has_sig": false, "md5_digest": "1d6c807537b0249148cdcb3aa97371ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4850, "upload_time": "2019-09-08T07:27:23", "url": "https://files.pythonhosted.org/packages/14/a5/c46b16138b9856526861bd5fa27f5629256bc073c00913d3eee39c020051/django-indices-0.0.4.post2.tar.gz" } ] }