All Projects → clokep → django-querysetsequence

clokep / django-querysetsequence

Licence: ISC license
Chain multiple (disparate) QuerySets in Django

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to django-querysetsequence

tagselector
Dependency-free JS library that turns select fields in customizable tag clouds
Stars: ✭ 19 (-79.35%)
Mutual labels:  multiple
MLChainDemo
链式文件生成器原理分析(一)
Stars: ✭ 18 (-80.43%)
Mutual labels:  chain
blockchain-in-node
This is an afternoon-project, a blockchain built in node, supporting PoW.
Stars: ✭ 20 (-78.26%)
Mutual labels:  chain
betterator
💯 A better sync and async iterator API.
Stars: ✭ 57 (-38.04%)
Mutual labels:  iterable
dart-more
More Dart — Literally.
Stars: ✭ 81 (-11.96%)
Mutual labels:  iterable
Regression
Multiple Regression Package for PHP
Stars: ✭ 88 (-4.35%)
Mutual labels:  multiple
Jest Chain
Chain Jest matchers together to create one powerful assertion 🃏⛓
Stars: ✭ 235 (+155.43%)
Mutual labels:  chain
DoubleStar
A personalized/enhanced re-creation of the Darkhotel "Double Star" APT exploit chain with a focus on Windows 8.1 and mixed with some of my own techniques
Stars: ✭ 140 (+52.17%)
Mutual labels:  chain
morton-nd
A header-only compile-time Morton encoding / decoding library for N dimensions.
Stars: ✭ 78 (-15.22%)
Mutual labels:  multiple
woodpecker
woodpecker http client for Android
Stars: ✭ 17 (-81.52%)
Mutual labels:  chain
PancakeTokenSniper
BSC BNB Pancake token sniper, buy, take profit and rug check
Stars: ✭ 184 (+100%)
Mutual labels:  chain
fast-cartesian
Fast cartesian product
Stars: ✭ 51 (-44.57%)
Mutual labels:  iterable
multiple-windows
This project is a chrome extension. It provide to create windows to different sizes and multiple for front-end developers.
Stars: ✭ 16 (-82.61%)
Mutual labels:  multiple
hd-address
An extensible HD Wallet Address management utility
Stars: ✭ 22 (-76.09%)
Mutual labels:  chain
IterTools.jl
Common functional iterator patterns
Stars: ✭ 124 (+34.78%)
Mutual labels:  chain
Chain
链喵 CMDB 本项目已停止开发!因长时间未对代码进行维护,可能会造成项目在不同环境上无法部署、运行BUG等问题,请知晓!项目仅供参考!
Stars: ✭ 240 (+160.87%)
Mutual labels:  chain
WPWatcher
Wordpress Watcher is a wrapper for WPScan that manages scans on multiple sites and reports by email and/or syslog. Schedule scans and get notified when vulnerabilities, outdated plugins and other risks are found.
Stars: ✭ 34 (-63.04%)
Mutual labels:  multiple
do
Simplest way to manage asynchronicity
Stars: ✭ 33 (-64.13%)
Mutual labels:  chain
MultiObjectTracker
Advanced multiple object tracker using dlib and OpenCV.
Stars: ✭ 56 (-39.13%)
Mutual labels:  multiple
chimera-framework
Simple Language Agnostic Framework for Stand Alone and Distributed Computing
Stars: ✭ 17 (-81.52%)
Mutual labels:  chain

Django QuerySetSequence

Documentation Status

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.

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.

pip install --upgrade django-querysetsequence

Basic Usage

# 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, and is optionally compatible with Django REST Framework 3.11+.

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].