{ "info": { "author": "Alexander Burdeinyi", "author_email": "bonus05@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Django ORM + Twisted + asyncio - blocking\n----------------------------------------\nThis is a library that contains a custom queryset and a custom manager that adds introspection to use\nthe twisted database api instead of django. It returns deferred (Future or coroutine) instead of just hitting the database.\n\n\nsince v0.6:\n-----------\n- added support for django_bulk_update (github.com/aykut/django-bulk-update)\n\n\nsince v0.5:\n-----------\n- model instance save method replacing on the fly, now u can:\n```python\nawait obj.save()\n```\n\nsince v0.3-0.4:\n-----------\n- get_or_create fix\n\n\nsince v0.2:\n-----------\n- mostly rewrited;\n- renamed package as \"twisted-django-orm\";\n- python 3.5.2+ now is required;\n- used asyncio to avoid \"callback hell\";\n- you still can obtain result as defered;\n- there are some untested cases;\n \n\nTo install:\n-----------\nPython 3.5.2+ is required\n\n1. pip install twango\n2. Import and set the manager as the manager for any model (see examples)\n3. Use it on the top of the twisted and asyncio\n\nThis will keep the orm from blocking when using the django orm!\n\nImportant\n-----------\nDoes not make job in asynchronous way, but goes into threads and do not perform blocking main reactor.\n\nExample 352+:\n--------\n```python\n\nq = await Operation.twisted.all()[:5].fetch()\nprint(q)\n\nb = await Operation.twisted.all().fetch()\nprint(b[5])\n\nasync for x in Operation.twisted.all().order_by('cell', 'status'):\n print(x.price, x.status, x.cell)\n\nasync for x in Operation.twisted.all().order_by('cell', 'status')[:5]:\n print(x.price, x.status, x.cell)\n\nx = await Operation.twisted.get(price=3000, status=1, cell=11)\nprint(x)\n\np = await Operation.twisted.count()\nprint(p)\n\nx, created = await Operation.twisted.update_or_create(defaults={'cell': 11, 'price': 333}, price=1, status=1, cell=25)\nprint(x)\n\nx, _created = await Operation.twisted.get_or_create(price=27, status=1, cell=11)\nprint(x)\n```\n\nExample (old):\n--------\nYou can create models that are separate to be used in twisted processes:\n\n```python\nfrom myapp import Book\nfrom twango.manager import TwistedManager\nfrom django.db.models.manager import Manager\n\nclass TwistedBook(Book):\n objects = Manager()\n twisted = TwistedManager()\n\n class Meta:\n app_label = 'myapp'\n proxy = True\n```\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/Bonus05/djangotworm/raw/master/djangotworm-0.6.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Bonus05/djangotworm", "keywords": "django orm twisted queryset async asyncio", "license": "https://github.com/Bonus05/djangotworm/blob/master/MIT-LICENSE.txt", "maintainer": "", "maintainer_email": "", "name": "djangotworm", "package_url": "https://pypi.org/project/djangotworm/", "platform": "", "project_url": "https://pypi.org/project/djangotworm/", "project_urls": { "Download": "https://github.com/Bonus05/djangotworm/raw/master/djangotworm-0.6.1.tar.gz", "Homepage": "https://github.com/Bonus05/djangotworm" }, "release_url": "https://pypi.org/project/djangotworm/0.6.1/", "requires_dist": null, "requires_python": "", "summary": "Django QuerySets that can be Twisted aware. Adds several methods on a custom manager and queryset that return deferreds/coroutine/future.", "version": "0.6.1" }, "last_serial": 3375423, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "aacefceea393856bf4adeded8b180138", "sha256": "d3b2caab70234ed706d081ef0542e90f32dfcb5f234baf84ecb89222637a3958" }, "downloads": -1, "filename": "djangotworm-0.2.0.tar.gz", "has_sig": false, "md5_digest": "aacefceea393856bf4adeded8b180138", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5072, "upload_time": "2017-10-04T21:00:02", "url": "https://files.pythonhosted.org/packages/bd/aa/387d55437b59a600aa3b0f6b479ac56dc7fc5cd5e8e001d75fe869f610ae/djangotworm-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "a4205aa52512e3bca12259f695398ba5", "sha256": "ba5fd7a95b6592a0ea76decd5fb053009dde642d55bdcb3a80408ee942578369" }, "downloads": -1, "filename": "djangotworm-0.3.0.tar.gz", "has_sig": false, "md5_digest": "a4205aa52512e3bca12259f695398ba5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6007, "upload_time": "2017-10-04T22:00:29", "url": "https://files.pythonhosted.org/packages/44/e4/199ba98fae4dd03729e6a1aa64da5294cc23bdfec2dd3ad8f90cd1149fe1/djangotworm-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "f9e986931359f945fe92827378409e16", "sha256": "716c04221b61c548e9ef68c868734680acde6845f6b5c306aab562bd89bff7d7" }, "downloads": -1, "filename": "djangotworm-0.4.0.tar.gz", "has_sig": false, "md5_digest": "f9e986931359f945fe92827378409e16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5989, "upload_time": "2017-10-04T22:11:42", "url": "https://files.pythonhosted.org/packages/ad/3c/50a96a02eaf4cead3005c5bed069fb6b72bf272a9eed6ea628b52734d1a9/djangotworm-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "ad1e4162f9cf7007abb17b0ca55562d5", "sha256": "9eff52132e04cf5b5f6cb2e0472459d85b30e150e1c9c5ffa25cba50c856b4bd" }, "downloads": -1, "filename": "djangotworm-0.5.0.tar.gz", "has_sig": false, "md5_digest": "ad1e4162f9cf7007abb17b0ca55562d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6475, "upload_time": "2017-10-08T09:00:02", "url": "https://files.pythonhosted.org/packages/9e/24/b0af3e2f17b05f373c9adc11d9d91a38ca3bb8e82104a5dd3a6d4a1f8a5d/djangotworm-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "1b38273ac96dc49c49388f8899ab8c0f", "sha256": "59b725a85fcd01ceb97546e6befe783d68978c8a28a9f1ecf2207679c8adc314" }, "downloads": -1, "filename": "djangotworm-0.6.0.tar.gz", "has_sig": false, "md5_digest": "1b38273ac96dc49c49388f8899ab8c0f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6623, "upload_time": "2017-11-28T23:20:38", "url": "https://files.pythonhosted.org/packages/df/1c/0464b7d47d4df506c4a2d4afaf9e61b9c9286a5add9bf9e233e49eeed5dd/djangotworm-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "a0e9c17cdc9f776d201a08438f05d3b9", "sha256": "fb6c70f62d9d6aaa0942e591604f54ec83c5600e5c7373d5b8c4c9b1a663fbaa" }, "downloads": -1, "filename": "djangotworm-0.6.1.tar.gz", "has_sig": false, "md5_digest": "a0e9c17cdc9f776d201a08438f05d3b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6623, "upload_time": "2017-11-29T21:36:54", "url": "https://files.pythonhosted.org/packages/84/08/9cacb83d0fae232fd45e209e40af9e743c8666e9185e0b334d7683bfc6ec/djangotworm-0.6.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a0e9c17cdc9f776d201a08438f05d3b9", "sha256": "fb6c70f62d9d6aaa0942e591604f54ec83c5600e5c7373d5b8c4c9b1a663fbaa" }, "downloads": -1, "filename": "djangotworm-0.6.1.tar.gz", "has_sig": false, "md5_digest": "a0e9c17cdc9f776d201a08438f05d3b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6623, "upload_time": "2017-11-29T21:36:54", "url": "https://files.pythonhosted.org/packages/84/08/9cacb83d0fae232fd45e209e40af9e743c8666e9185e0b334d7683bfc6ec/djangotworm-0.6.1.tar.gz" } ] }