Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
django-querysetsequence
Advanced tools
Chain together multiple (disparate) QuerySets to treat them as a single QuerySet.
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.
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:
filter()
, exclude()
,
get()
, order_by()
) must use fields that are common across all
sub-QuerySets
.'foo__bar'
, 'foo'
, or
'foo_id'
). syntax).QuerySets
are evaluated as late as possible (e.g. during
iteration, slicing, pickling, repr()
/len()
/list()
/bool()
calls).QuerySet
API methods that are untested/unimplemented raise
NotImplementedError
.Install the package using pip.
.. code-block:: bash
pip install --upgrade django-querysetsequence
.. 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.
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:
FAQs
Chain together multiple (disparate) QuerySets to treat them as a single QuerySet.
We found that django-querysetsequence demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.