django-querysetsequence


Namedjango-querysetsequence JSON
Version 0.17 PyPI version JSON
download
home_pagehttps://github.com/clokep/django-querysetsequence
SummaryChain together multiple (disparate) QuerySets to treat them as a single QuerySet.
upload_time2023-06-27 17:35:22
maintainer
docs_urlNone
authorPatrick Cloke
requires_python>=3.8
licenseISC
keywords django queryset chain multi multiple iterable
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            Django QuerySetSequence
#######################

.. image:: https://img.shields.io/pypi/v/django-querysetsequence.svg
    :target: https://pypi.org/project/django-querysetsequence/

.. image:: https://github.com/clokep/django-querysetsequence/actions/workflows/main.yml/badge.svg
    :target: https://github.com/clokep/django-querysetsequence/actions/workflows/main.yml

.. image:: https://readthedocs.org/projects/django-querysetsequence/badge/?version=latest
    :target: https://django-querysetsequence.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

.. include-start

django-querysetsequence adds helpers for treating multiple disparate ``QuerySet``
obejcts as a single ``QuerySet``. This is useful for passing into APIs that only
accepted a single ``QuerySet``.

The ``QuerySetSequence`` wrapper is used to combine multiple ``QuerySet`` instances.


Overview
========

``QuerySetSequence`` aims to provide the same behavior as Django's |QuerySets|_,
but applied across multiple ``QuerySet`` instances.

.. |QuerySets| replace:: ``QuerySets``
.. _QuerySets: https://docs.djangoproject.com/en/dev/ref/models/querysets/

Supported features:

* Methods that take a list of fields (e.g. ``filter()``, ``exclude()``,
  ``get()``, ``order_by()``) must use fields that are common across all
  sub-``QuerySets``.
* Relationships across related models work (e.g. ``'foo__bar'``, ``'foo'``, or
  ``'foo_id'``). syntax).
* The sub-``QuerySets`` are evaluated as late as possible (e.g. during
  iteration, slicing, pickling, ``repr()``/``len()``/``list()``/``bool()``
  calls).
* Public ``QuerySet`` API methods that are untested/unimplemented raise
  ``NotImplementedError``.


Getting Started
===============

Install the package using pip.

.. code-block:: bash

    pip install --upgrade django-querysetsequence


Basic Usage
===========

.. code-block:: python

    # Import QuerySetSequence
    from queryset_sequence import QuerySetSequence

    # Create QuerySets you want to chain.
    from .models import SomeModel, OtherModel

    # Chain them together.
    query = QuerySetSequence(SomeModel.objects.all(), OtherModel.objects.all())

    # Use query as if it were a QuerySet! E.g. in a ListView.


Project Information
===================

django-querysetsequence is released under the ISC license, its documentation lives
on `Read the Docs`_, the code on `GitHub`_, and the latest release on `PyPI`_. It
supports Python 3.7+, Django 3.2/4.0/4.1/4.2, and is optionally compatible with
`Django REST Framework`_ 3.11+.

.. _Read the Docs: https://django-querysetsequence.readthedocs.io/
.. _GitHub: https://github.com/clokep/django-querysetsequence
.. _PyPI: https://pypi.org/project/django-querysetsequence/
.. _Django REST Framework: http://www.django-rest-framework.org/

Some ways that you can contribute:

* Check for open issues or open a fresh issue to start a discussion around a
  feature idea or a bug.
* Fork the repository on GitHub to start making your changes.
* Write a test which shows that the bug was fixed or that the feature works as
  expected.
* Send a pull request and bug the maintainer until it gets merged and published.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/clokep/django-querysetsequence",
    "name": "django-querysetsequence",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "django,queryset,chain,multi,multiple,iterable",
    "author": "Patrick Cloke",
    "author_email": "clokep@patrick.cloke.us",
    "download_url": "https://files.pythonhosted.org/packages/99/8b/e73e4c4745caf20779f32b0841208ad3d5011a5b5464247f5b4d87ff4dba/django-querysetsequence-0.17.tar.gz",
    "platform": null,
    "description": "Django QuerySetSequence\n#######################\n\n.. image:: https://img.shields.io/pypi/v/django-querysetsequence.svg\n    :target: https://pypi.org/project/django-querysetsequence/\n\n.. image:: https://github.com/clokep/django-querysetsequence/actions/workflows/main.yml/badge.svg\n    :target: https://github.com/clokep/django-querysetsequence/actions/workflows/main.yml\n\n.. image:: https://readthedocs.org/projects/django-querysetsequence/badge/?version=latest\n    :target: https://django-querysetsequence.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. include-start\n\ndjango-querysetsequence adds helpers for treating multiple disparate ``QuerySet``\nobejcts as a single ``QuerySet``. This is useful for passing into APIs that only\naccepted a single ``QuerySet``.\n\nThe ``QuerySetSequence`` wrapper is used to combine multiple ``QuerySet`` instances.\n\n\nOverview\n========\n\n``QuerySetSequence`` aims to provide the same behavior as Django's |QuerySets|_,\nbut applied across multiple ``QuerySet`` instances.\n\n.. |QuerySets| replace:: ``QuerySets``\n.. _QuerySets: https://docs.djangoproject.com/en/dev/ref/models/querysets/\n\nSupported features:\n\n* Methods that take a list of fields (e.g. ``filter()``, ``exclude()``,\n  ``get()``, ``order_by()``) must use fields that are common across all\n  sub-``QuerySets``.\n* Relationships across related models work (e.g. ``'foo__bar'``, ``'foo'``, or\n  ``'foo_id'``). syntax).\n* The sub-``QuerySets`` are evaluated as late as possible (e.g. during\n  iteration, slicing, pickling, ``repr()``/``len()``/``list()``/``bool()``\n  calls).\n* Public ``QuerySet`` API methods that are untested/unimplemented raise\n  ``NotImplementedError``.\n\n\nGetting Started\n===============\n\nInstall the package using pip.\n\n.. code-block:: bash\n\n    pip install --upgrade django-querysetsequence\n\n\nBasic Usage\n===========\n\n.. code-block:: python\n\n    # Import QuerySetSequence\n    from queryset_sequence import QuerySetSequence\n\n    # Create QuerySets you want to chain.\n    from .models import SomeModel, OtherModel\n\n    # Chain them together.\n    query = QuerySetSequence(SomeModel.objects.all(), OtherModel.objects.all())\n\n    # Use query as if it were a QuerySet! E.g. in a ListView.\n\n\nProject Information\n===================\n\ndjango-querysetsequence is released under the ISC license, its documentation lives\non `Read the Docs`_, the code on `GitHub`_, and the latest release on `PyPI`_. It\nsupports Python 3.7+, Django 3.2/4.0/4.1/4.2, and is optionally compatible with\n`Django REST Framework`_ 3.11+.\n\n.. _Read the Docs: https://django-querysetsequence.readthedocs.io/\n.. _GitHub: https://github.com/clokep/django-querysetsequence\n.. _PyPI: https://pypi.org/project/django-querysetsequence/\n.. _Django REST Framework: http://www.django-rest-framework.org/\n\nSome ways that you can contribute:\n\n* Check for open issues or open a fresh issue to start a discussion around a\n  feature idea or a bug.\n* Fork the repository on GitHub to start making your changes.\n* Write a test which shows that the bug was fixed or that the feature works as\n  expected.\n* Send a pull request and bug the maintainer until it gets merged and published.\n",
    "bugtrack_url": null,
    "license": "ISC",
    "summary": "Chain together multiple (disparate) QuerySets to treat them as a single QuerySet.",
    "version": "0.17",
    "project_urls": {
        "Documentation": "https://django-querysetsequence.readthedocs.io",
        "Funding": "https://github.com/sponsors/clokep",
        "Homepage": "https://github.com/clokep/django-querysetsequence",
        "Release notes": "https://github.com/clokep/django-querysetsequence/blob/main/CHANGELOG.rst",
        "Source": "https://github.com/clokep/django-querysetsequence",
        "Tracker": "https://github.com/clokep/django-querysetsequence/issues"
    },
    "split_keywords": [
        "django",
        "queryset",
        "chain",
        "multi",
        "multiple",
        "iterable"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f9f87b5a4bf21dbe4ecc5b3d31626318456d3b7c442a74175e7e489d27ba270a",
                "md5": "a106f7c2f11a96940fbcd3ae4065b51a",
                "sha256": "02f7c2025dc6fbaf659a91d84eaa333846be1e3530828b283e3f8b7912f49b75"
            },
            "downloads": -1,
            "filename": "django_querysetsequence-0.17-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a106f7c2f11a96940fbcd3ae4065b51a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 16267,
            "upload_time": "2023-06-27T17:35:21",
            "upload_time_iso_8601": "2023-06-27T17:35:21.376989Z",
            "url": "https://files.pythonhosted.org/packages/f9/f8/7b5a4bf21dbe4ecc5b3d31626318456d3b7c442a74175e7e489d27ba270a/django_querysetsequence-0.17-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "998be73e4c4745caf20779f32b0841208ad3d5011a5b5464247f5b4d87ff4dba",
                "md5": "220163adde3c47d6e7fd37b5af3ec6b1",
                "sha256": "056e62d138191c65a3d36ad773ae4ba3adbfd6a776339b62572e7f7cc70d867d"
            },
            "downloads": -1,
            "filename": "django-querysetsequence-0.17.tar.gz",
            "has_sig": false,
            "md5_digest": "220163adde3c47d6e7fd37b5af3ec6b1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 30397,
            "upload_time": "2023-06-27T17:35:22",
            "upload_time_iso_8601": "2023-06-27T17:35:22.806289Z",
            "url": "https://files.pythonhosted.org/packages/99/8b/e73e4c4745caf20779f32b0841208ad3d5011a5b5464247f5b4d87ff4dba/django-querysetsequence-0.17.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-27 17:35:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "clokep",
    "github_project": "django-querysetsequence",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "django-querysetsequence"
}
        
Elapsed time: 0.08831s