Skip to content

Instantly share code, notes, and snippets.

View tusharsrivastava's full-sized avatar
🎯
Focusing

Tushar Srivastava tusharsrivastava

🎯
Focusing
View GitHub Profile
@tusharsrivastava
tusharsrivastava / django-custom-join.py
Created July 24, 2020 12:00 — forked from debanshuk/django-custom-join.py
Utility functions to add join to queryset or a table to a django ORM queryset.
from django.db.models.fields.related import ForeignObject
from django.db.models.options import Options
from django.db.models.sql.constants import INNER
from django.db.models.sql.datastructures import Join
from django.db.models.sql.where import ExtraWhere
class CustomJoin(Join):
def __init__(self, subquery, subquery_params, parent_alias, table_alias, join_type, join_field, nullable): # noqa
self.subquery_params = subquery_params