django-cte 1.3.3.dev20250526204410__py3-none-any.whl → 1.3.3.dev20250527184022__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_cte/__init__.py +1 -1
- django_cte/cte.py +29 -0
- {django_cte-1.3.3.dev20250526204410.dist-info → django_cte-1.3.3.dev20250527184022.dist-info}/METADATA +1 -1
- {django_cte-1.3.3.dev20250526204410.dist-info → django_cte-1.3.3.dev20250527184022.dist-info}/RECORD +6 -6
- {django_cte-1.3.3.dev20250526204410.dist-info → django_cte-1.3.3.dev20250527184022.dist-info}/WHEEL +0 -0
- {django_cte-1.3.3.dev20250526204410.dist-info → django_cte-1.3.3.dev20250527184022.dist-info}/licenses/LICENSE +0 -0
django_cte/__init__.py
CHANGED
django_cte/cte.py
CHANGED
|
@@ -153,6 +153,35 @@ class CTEQuerySet(QuerySet):
|
|
|
153
153
|
as_manager.queryset_only = True
|
|
154
154
|
as_manager = classmethod(as_manager)
|
|
155
155
|
|
|
156
|
+
def _combinator_query(self, *args, **kw):
|
|
157
|
+
clone = super()._combinator_query(*args, **kw)
|
|
158
|
+
if clone.query.combinator:
|
|
159
|
+
ctes = clone.query._with_ctes = []
|
|
160
|
+
seen = {}
|
|
161
|
+
for query in clone.query.combined_queries:
|
|
162
|
+
for cte in getattr(query, "_with_ctes", []):
|
|
163
|
+
if seen.get(cte.name) is cte:
|
|
164
|
+
continue
|
|
165
|
+
if cte.name in seen:
|
|
166
|
+
raise ValueError(
|
|
167
|
+
f"Found two or more CTEs named '{cte.name}'. "
|
|
168
|
+
"Hint: assign a unique name to each CTE."
|
|
169
|
+
)
|
|
170
|
+
ctes.append(cte)
|
|
171
|
+
seen[cte.name] = cte
|
|
172
|
+
if ctes:
|
|
173
|
+
def without_ctes(query):
|
|
174
|
+
if getattr(query, "_with_ctes", None):
|
|
175
|
+
query = query.clone()
|
|
176
|
+
query._with_ctes = []
|
|
177
|
+
return query
|
|
178
|
+
|
|
179
|
+
clone.query.combined_queries = [
|
|
180
|
+
without_ctes(query)
|
|
181
|
+
for query in clone.query.combined_queries
|
|
182
|
+
]
|
|
183
|
+
return clone
|
|
184
|
+
|
|
156
185
|
|
|
157
186
|
class CTEManager(Manager.from_queryset(CTEQuerySet)):
|
|
158
187
|
"""Manager for models that perform CTE queries"""
|
{django_cte-1.3.3.dev20250526204410.dist-info → django_cte-1.3.3.dev20250527184022.dist-info}/RECORD
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
django_cte/__init__.py,sha256=
|
|
2
|
-
django_cte/cte.py,sha256=
|
|
1
|
+
django_cte/__init__.py,sha256=Q8M2wwMlJCn9eA0NBVVOSpR3DBpXOfyQ-t_ZIS8xaFI,96
|
|
2
|
+
django_cte/cte.py,sha256=F_vHEs0lSlxVj4rOSC26g9Liniz2jyLfnTv-7LUxRlc,7728
|
|
3
3
|
django_cte/expressions.py,sha256=taT2trCz4z0YmOGVXzR9XXquPR43OH6xghNWAplc3lM,1930
|
|
4
4
|
django_cte/join.py,sha256=HrO31WKx3j5RiEWf7dDOXbBfeeUPFEbNLo3gzzt3qbo,3164
|
|
5
5
|
django_cte/meta.py,sha256=PIu7iW_tu3gBCpiBRfVHvuJKSSND2IsaNhoT01WEEJM,3535
|
|
6
6
|
django_cte/query.py,sha256=A16buWFqWJZ2RA1WUby7tdC_uxmn9XNLuCewjJAg1mk,8314
|
|
7
7
|
django_cte/raw.py,sha256=nROVPEVRc3_zKAFcED6KR8Rr6FTTn8jQDFQWfi-X3-A,1077
|
|
8
|
-
django_cte-1.3.3.
|
|
9
|
-
django_cte-1.3.3.
|
|
10
|
-
django_cte-1.3.3.
|
|
11
|
-
django_cte-1.3.3.
|
|
8
|
+
django_cte-1.3.3.dev20250527184022.dist-info/licenses/LICENSE,sha256=mkLNw_QhpZ40jBEbuAosqH4ciA3KMrwb8aSYbTmy5gc,1508
|
|
9
|
+
django_cte-1.3.3.dev20250527184022.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
10
|
+
django_cte-1.3.3.dev20250527184022.dist-info/METADATA,sha256=QifFXHQlo5yIZ4rdQD20c848J2VUsarSf8GZvlyWyOY,2645
|
|
11
|
+
django_cte-1.3.3.dev20250527184022.dist-info/RECORD,,
|
{django_cte-1.3.3.dev20250526204410.dist-info → django_cte-1.3.3.dev20250527184022.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|