{ "info": { "author": "Evgeniy Krysanov", "author_email": "evgeniy.krysanov@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "=====================\r\ndjango-quantity-field\r\n=====================\r\n\r\nA Django application providing model and form field\r\nto accept and store multidimensional physical quantities.\r\n\r\n\r\nRequirements\r\n============\r\n\r\nThis application depends on ``Pint`` library, used for operate\r\nand manipulate physical quantities. Full documentation is\r\navailable at http://pint.readthedocs.org/\r\n\r\n\r\nInstallation\r\n============\r\n\r\nInstall django-quantity-field using pip: ``pip install django-quantity-field``.\r\n\r\n\r\nUsage\r\n=====\r\n\r\nIn order to use a quantity field add it to your model definition::\r\n\r\n from quantity_field import ureg\r\n from quantity_field.fields import MultiQuantityField\r\n\r\n class Package(models.Model):\r\n size = MultiQuantityField(dim=3, units=(ureg.mm, ureg.cm, ureg.m))\r\n weight = MultiQuantityField(units=(ureg.g, ureg.kg))\r\n\r\n``django-quantity-field`` comes with the custom form field that is\r\nused by default for editing in admin or in your forms.\r\n\r\nAccessing ``MultiQuantityField`` field will returns ``MultiQuantity`` object\r\nthat can be used as ordinary Pint quantities.\r\n\r\n >>> from quantity_field.base import MultiQuantity\r\n >>> size = MultiQuantity.from_list(2, 5.5, 4, str(ureg.m))\r\n >>> size\r\n \r\n >>> size.dim\r\n 3\r\n >>> [v for v in size]\r\n [, , ]\r\n\r\n\r\nWarning\r\n=======\r\n\r\nDon't forget there are no global units in Pint. To use Pint quantities\r\nin your project side by side with ``django-quantity-field`` use\r\nPint registry from our application.\r\n\r\n >>> from quantity_field import ureg\r\n >>> from quantity_field.base import MultiQuantity\r\n >>> box = MultiQuantity.from_string('42 kg')\r\n >>> box + 2.2 * ureg.kg\r\n \r\n\r\n\r\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/catcombo/django-quantity-field", "keywords": "django multiple quantity field", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-quantity-field", "package_url": "https://pypi.org/project/django-quantity-field/", "platform": "", "project_url": "https://pypi.org/project/django-quantity-field/", "project_urls": { "Homepage": "https://github.com/catcombo/django-quantity-field" }, "release_url": "https://pypi.org/project/django-quantity-field/1.0.1/", "requires_dist": [ "Pint" ], "requires_python": "", "summary": "Field for Django models that stores multidimensional physical quantities", "version": "1.0.1" }, "last_serial": 3324182, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "43532bc06b181dc0a9946c16460e38a9", "sha256": "fcce2d6233250ddf297b8ab3474cdb06f0d0baf05a67198da76086e84e31d1c0" }, "downloads": -1, "filename": "django_quantity_field-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "43532bc06b181dc0a9946c16460e38a9", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 8256, "upload_time": "2017-03-24T21:40:10", "url": "https://files.pythonhosted.org/packages/22/e1/59e8efaea647f597078615b029d0ebaf582a6d22126c38aff14cb202bd00/django_quantity_field-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "65d9fc33ff37932e11678deb098285b0", "sha256": "5762ae5a28dfc4255873f416e5f98975bd50dfe3e3568cdcaf6876f57593dfd7" }, "downloads": -1, "filename": "django-quantity-field-1.0.0.tar.gz", "has_sig": false, "md5_digest": "65d9fc33ff37932e11678deb098285b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4730, "upload_time": "2017-03-24T21:40:12", "url": "https://files.pythonhosted.org/packages/9a/6e/95a472ce0f590fbbc91c2c9f9beea1255fe8f7cfffa9aaf56889d6d7377e/django-quantity-field-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "14e48e26a03f84f36c77409855a773b8", "sha256": "054c8b325e10c06987424d0a970a19d18c39c0bb0c30b93578db030417d740f0" }, "downloads": -1, "filename": "django_quantity_field-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "14e48e26a03f84f36c77409855a773b8", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 8367, "upload_time": "2017-11-11T10:50:54", "url": "https://files.pythonhosted.org/packages/8a/e1/b4eeeb61e2d75d5d3660f6682f5ccb4484b1b2213fb86e4101b179afc4c4/django_quantity_field-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e0fd97a70c004ff89c1e93f227dea063", "sha256": "b19a039a8d7c7cbee3269c296c3c34c7add5d8d705412cc9d8db76f8669d2bb0" }, "downloads": -1, "filename": "django-quantity-field-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e0fd97a70c004ff89c1e93f227dea063", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4812, "upload_time": "2017-11-11T10:50:55", "url": "https://files.pythonhosted.org/packages/d9/35/6f7fb9971193e3acfc86e66ce0b5e0e2f4f1082443dfb4d22d8a121c6260/django-quantity-field-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "14e48e26a03f84f36c77409855a773b8", "sha256": "054c8b325e10c06987424d0a970a19d18c39c0bb0c30b93578db030417d740f0" }, "downloads": -1, "filename": "django_quantity_field-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "14e48e26a03f84f36c77409855a773b8", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 8367, "upload_time": "2017-11-11T10:50:54", "url": "https://files.pythonhosted.org/packages/8a/e1/b4eeeb61e2d75d5d3660f6682f5ccb4484b1b2213fb86e4101b179afc4c4/django_quantity_field-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e0fd97a70c004ff89c1e93f227dea063", "sha256": "b19a039a8d7c7cbee3269c296c3c34c7add5d8d705412cc9d8db76f8669d2bb0" }, "downloads": -1, "filename": "django-quantity-field-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e0fd97a70c004ff89c1e93f227dea063", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4812, "upload_time": "2017-11-11T10:50:55", "url": "https://files.pythonhosted.org/packages/d9/35/6f7fb9971193e3acfc86e66ce0b5e0e2f4f1082443dfb4d22d8a121c6260/django-quantity-field-1.0.1.tar.gz" } ] }