{ "info": { "author": "Andrey Antukh", "author_email": "niwi@niwi.be", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP" ], "description": "djorm-ext-pgarray\n=================\n\nPostgreSQL array field for Django.\n\n- **Blog post:** http://www.niwi.be/2012/10/07/postgresql-array-fields-with-django/\n\nIntroduction\n------------\n\nDjango by default, has a large collection of possible types that can be used to define the\nmodel. But sometimes we need to use some more complex types offered by PostgreSQL. In this\ncase, we will look the integrating of PostgreSQL array with Django.\n\nQuickstart\n----------\n\n**djorm-ext-pgarray** exposes a simple django model field `djorm_pgarray.fields.ArrayField`.\nThis accepts two additional parameters: **dbtype** that represents a postgresql type, and\n**dimension** that represents a dimension of array field.\n\nThis is a sample definition of model using a ArrayField:\n\n.. code-block:: python\n\n from django.db import models\n from djorm_pgarray.fields import ArrayField\n from djorm_expressions.models import ExpressionManager\n\n class Register(models.Model):\n name = models.CharField(max_length=200)\n points = ArrayField(dbtype=\"int\")\n objects = ExpressionManager()\n\n class Register2(models.Model):\n name = models.CharField(max_length=200)\n texts = ArrayField(dbtype=\"text\", dimension=2) # this creates `points text[][]` postgresql field.\n objects = ExpressionManager()\n\n\nCreating objects\n~~~~~~~~~~~~~~~~\n\nThis is a sample example of creating objects with array fields.\n\n.. code-block:: pycon\n\n >>> Register.objects.create(points = [1,2,3,4])\n \n >>> Register2.objects.create(texts = [['Hello', 'World'], ['Hola', 'Mundo']])\n \n\n\nUsing custom PostgreSQL data types\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSome times we need use some other data types that postgresql offers for make arrays and\ndjorm-ext-pgarray does not offers builtin support for it. Now, djorm-ext-pgarray\nsupports a simple way to extend it:\n\n.. code-block:: python\n\n class Register(models.Model):\n name = models.CharField(max_length=200)\n macs = ArrayField(dbtype=\"macaddr\", type_cast=lambda x: str(x))\n # Same as previous line but uses str as callback directly\n # macs = ArrayField(dbtype=\"macaddr\", type_cast=str)\n objects = ExpressionManager()\n\nIf type_cast patameter is not None, ArrayField ignores the no existence of a builtin\ncast function for some type and use a function passed throught type_cast argument.\n\n\nHow install it?\n---------------\n\nYou can clone the repo from github and install with simple python setup.py install\ncommand. Or use a pip, for install it from Python Package Index.\n\n.. code-block:: console\n\n pip install djorm-ext-pgarray\n\nAdditionally, you can install djorm-ext-expressions, that can help with complex queries\nusing array fields.\n\n\nKnown issues\n------------\n\n- Querysets using expressions package can not be used as subqueries. Because alias\n propagation is not working properly.\n", "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/niwibe/djorm-ext-pgarray", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "djorm-ext-pgarray", "package_url": "https://pypi.org/project/djorm-ext-pgarray/", "platform": "OS Independent", "project_url": "https://pypi.org/project/djorm-ext-pgarray/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/niwibe/djorm-ext-pgarray" }, "release_url": "https://pypi.org/project/djorm-ext-pgarray/0.10/", "requires_dist": null, "requires_python": null, "summary": "PostgreSQL native array fields extension for Django.", "version": "0.10" }, "last_serial": 981763, "releases": { "0.10": [ { "comment_text": "", "digests": { "md5": "d6e1d31a89e7a01654b380e27cf68652", "sha256": "9acc45d315ac26d307fb79b75cec1d56cdff27d673a52606c17d6ab7ceb14123" }, "downloads": -1, "filename": "djorm-ext-pgarray-0.10.tar.gz", "has_sig": false, "md5_digest": "d6e1d31a89e7a01654b380e27cf68652", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3688, "upload_time": "2014-01-26T12:43:33", "url": "https://files.pythonhosted.org/packages/3f/3d/0cfd4b6a0e8611879fb3ba6825a9d5182dbd10e591a9dac06de51b41d67b/djorm-ext-pgarray-0.10.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "4adb3e11df107131f09d18bc165a17cd", "sha256": "702c94da78f841afe2a161e5c13d7554a7e42c66d3a7da1491fc267e426c3371" }, "downloads": -1, "filename": "djorm-ext-pgarray-0.4.0.tar.gz", "has_sig": false, "md5_digest": "4adb3e11df107131f09d18bc165a17cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1802, "upload_time": "2012-10-08T06:45:04", "url": "https://files.pythonhosted.org/packages/fc/b7/e2d67fe2b7a64b9d495fec144d4ef3ab2c254a1aa3e10809a9e31784e554/djorm-ext-pgarray-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "d57420f295f2b7d10473763566f4ee95", "sha256": "cece07b45f7d3cf79d7be998f8638aa242f1d2f7c9918e2cbbc62ebfb447bfd5" }, "downloads": -1, "filename": "djorm-ext-pgarray-0.4.1.tar.gz", "has_sig": false, "md5_digest": "d57420f295f2b7d10473763566f4ee95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1812, "upload_time": "2012-10-20T20:01:40", "url": "https://files.pythonhosted.org/packages/13/34/7c9f017ec546b7df4654a81697d5584fb2a151dbf9235052823ae6a67558/djorm-ext-pgarray-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "01eb52313a5deeba9791a3928196006e", "sha256": "1cf0d15d6e09541ed48c23b0ef0e73b4139b7a14802f496c76243585c3ee2c71" }, "downloads": -1, "filename": "djorm-ext-pgarray-0.4.2.tar.gz", "has_sig": false, "md5_digest": "01eb52313a5deeba9791a3928196006e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1850, "upload_time": "2013-03-28T00:13:08", "url": "https://files.pythonhosted.org/packages/0d/2c/92c9a4cc8f0e11c2e204c7da298950c52de16fe2604ef44fce57f2e71300/djorm-ext-pgarray-0.4.2.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "02ef40e1ba1fd18ced2adaeebc3b661b", "sha256": "84aa51802d088c429de500d7950f5c8fd87b65a5c86e3c7d092d3cbea02693d1" }, "downloads": -1, "filename": "djorm-ext-pgarray-0.5.tar.gz", "has_sig": false, "md5_digest": "02ef40e1ba1fd18ced2adaeebc3b661b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2030, "upload_time": "2013-05-27T14:30:13", "url": "https://files.pythonhosted.org/packages/9c/28/638e51258c924bf2f046241bb02fad64d94cad071634ec6cc75a558b9486/djorm-ext-pgarray-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "ed347682936a45d24a025ff2df38db91", "sha256": "049b0e313ba8b14b2462cae21be30a08240ba468e85164a5411930948e9340dc" }, "downloads": -1, "filename": "djorm-ext-pgarray-0.6.tar.gz", "has_sig": false, "md5_digest": "ed347682936a45d24a025ff2df38db91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2219, "upload_time": "2013-07-07T11:27:33", "url": "https://files.pythonhosted.org/packages/da/05/ab85c1e2507d6aa4c8b64da429de6cb9d8cb276b97fcb286e0ec99a4689a/djorm-ext-pgarray-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "767e1927ab91af9edb878394f1bbdbaa", "sha256": "a9917200bd086bc225a851bfcbf163cd5576c7181abe546701e8d5a54a737d00" }, "downloads": -1, "filename": "djorm-ext-pgarray-0.7.tar.gz", "has_sig": false, "md5_digest": "767e1927ab91af9edb878394f1bbdbaa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2500, "upload_time": "2013-08-24T13:38:15", "url": "https://files.pythonhosted.org/packages/37/1d/6cb47bbdefe971f8d5b3e911248593ddaca6c6d8726a1357397871d78a8a/djorm-ext-pgarray-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "346b1d92c67f79729bf79d25b8f76ce1", "sha256": "4b94614ef226de02cdb79e821c630d38c93f755501fa419910104445d8674d8d" }, "downloads": -1, "filename": "djorm-ext-pgarray-0.8.tar.gz", "has_sig": false, "md5_digest": "346b1d92c67f79729bf79d25b8f76ce1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2638, "upload_time": "2013-08-27T21:27:42", "url": "https://files.pythonhosted.org/packages/f6/12/3a0630e4ed685a3cce0ca1786401d03938708119991f430e446bc817e283/djorm-ext-pgarray-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "fb6e403698527795b2ddd7f6af2383d6", "sha256": "897ae89f229dcf86cf4f00a898580a61b314303b74e06fbeb49fecc9979dbe50" }, "downloads": -1, "filename": "djorm-ext-pgarray-0.9.tar.gz", "has_sig": false, "md5_digest": "fb6e403698527795b2ddd7f6af2383d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2681, "upload_time": "2013-12-06T11:14:15", "url": "https://files.pythonhosted.org/packages/8a/5e/6598d70bd104f06a6a19bbc9b55ba8e70e8feea51c9a7168b79903db8a78/djorm-ext-pgarray-0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d6e1d31a89e7a01654b380e27cf68652", "sha256": "9acc45d315ac26d307fb79b75cec1d56cdff27d673a52606c17d6ab7ceb14123" }, "downloads": -1, "filename": "djorm-ext-pgarray-0.10.tar.gz", "has_sig": false, "md5_digest": "d6e1d31a89e7a01654b380e27cf68652", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3688, "upload_time": "2014-01-26T12:43:33", "url": "https://files.pythonhosted.org/packages/3f/3d/0cfd4b6a0e8611879fb3ba6825a9d5182dbd10e591a9dac06de51b41d67b/djorm-ext-pgarray-0.10.tar.gz" } ] }