django-cte 2.0.0.dev20250616152647__py3-none-any.whl → 2.0.1.dev20251006182758__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 CHANGED
@@ -1,4 +1,4 @@
1
1
  from .cte import CTE, with_cte, CTEManager, CTEQuerySet, With # noqa
2
2
 
3
- __version__ = "2.0.0.dev20250616152647"
3
+ __version__ = "2.0.1.dev20251006182758"
4
4
  __all__ = ["CTE", "with_cte"]
django_cte/cte.py CHANGED
@@ -58,7 +58,7 @@ class CTE:
58
58
  self.col = CTEColumns(self)
59
59
 
60
60
  def __repr__(self):
61
- return "<With {}>".format(self.name)
61
+ return f"<{type(self).__name__} {self.name}>"
62
62
 
63
63
  @classmethod
64
64
  def recursive(cls, make_cte_queryset, name="cte", materialized=False):
@@ -80,7 +80,6 @@ class CTE:
80
80
  """Join this CTE to the given model or queryset
81
81
 
82
82
  This CTE will be referenced by the returned queryset, but the
83
-
84
83
  corresponding `WITH ...` statement will not be prepended to the
85
84
  queryset's SQL output; use `with_cte(cte, select=cte.join(...))`
86
85
  to achieve that outcome.
@@ -133,15 +132,15 @@ class CTE:
133
132
  if cte_query.values_select:
134
133
  query.set_values(cte_query.values_select)
135
134
  qs._iterable_class = ValuesIterable
136
- for alias in getattr(cte_query, "selected", None) or ():
137
- if alias not in cte_query.annotations:
138
- col = Ref(alias, cte_query.resolve_ref(alias))
139
- query.add_annotation(col, alias)
140
135
  if cte_query.annotations:
141
136
  for alias, value in cte_query.annotations.items():
142
137
  col = CTEColumnRef(alias, self.name, value.output_field)
143
138
  query.add_annotation(col, alias)
144
139
  query.annotation_select_mask = cte_query.annotation_select_mask
140
+ for alias in getattr(cte_query, "selected", None) or ():
141
+ if alias not in cte_query.annotations:
142
+ col = Ref(alias, cte_query.resolve_ref(alias))
143
+ query.add_annotation(col, alias)
145
144
 
146
145
  qs.query = query
147
146
  return qs
@@ -1,15 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-cte
3
- Version: 2.0.0.dev20250616152647
3
+ Version: 2.0.1.dev20251006182758
4
4
  Summary: Common Table Expressions (CTE) for Django
5
5
  Author-email: Daniel Miller <millerdev@gmail.com>
6
6
  Requires-Python: >= 3.9
7
7
  Description-Content-Type: text/markdown
8
+ License-Expression: BSD-3-Clause
8
9
  Classifier: Development Status :: 5 - Production/Stable
9
10
  Classifier: Environment :: Web Environment
10
- Classifier: Framework :: Django
11
11
  Classifier: Intended Audience :: Developers
12
- Classifier: License :: OSI Approved :: BSD License
13
12
  Classifier: Operating System :: OS Independent
14
13
  Classifier: Programming Language :: Python
15
14
  Classifier: Programming Language :: Python :: 3
@@ -1,12 +1,12 @@
1
- django_cte/__init__.py,sha256=QXPp-htboR_5QDL4di8vYDDanmMtUiX3myxA8tBHit0,141
1
+ django_cte/__init__.py,sha256=azASdmHqhhwjSDGsVXjCH5eqkMIzON9T7GsJmpazLmU,141
2
2
  django_cte/_deprecated.py,sha256=OAEmWVqnoi-27m2nyrfTIwVwPE1J8VLrfspgRHW-EZI,5623
3
- django_cte/cte.py,sha256=Rs_luCEFK39UEOm4rRaL2L5BztfvN9ST-Y7RVrjub_c,8129
3
+ django_cte/cte.py,sha256=8U0asXClTikaF--Iorsp5eKBw0aoOQSvfu22h1zZZf4,8137
4
4
  django_cte/jitmixin.py,sha256=JRTRlbBhD8XD0GHwxg8wKdJSbcTv_zUrSyqtOSfgM5M,885
5
5
  django_cte/join.py,sha256=2b1iBKFFiqBqYBmX4W9q2RfX17xXjZbbzClpUdbnUtA,3156
6
6
  django_cte/meta.py,sha256=gNBtegkvg5CXcEPyt1nZMIF2UlsPMTUPStVJSsRni3I,3491
7
7
  django_cte/query.py,sha256=djY7Bknl_NQSd1g6zy8N3fU3h2r8OfpyeJY_Zt9a7fg,5582
8
8
  django_cte/raw.py,sha256=6_YDCKBsgXx1oQku4EcyK4qJmnmiyzEeZRxiYdkg8Y8,1045
9
- django_cte-2.0.0.dev20250616152647.dist-info/licenses/LICENSE,sha256=mkLNw_QhpZ40jBEbuAosqH4ciA3KMrwb8aSYbTmy5gc,1508
10
- django_cte-2.0.0.dev20250616152647.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
11
- django_cte-2.0.0.dev20250616152647.dist-info/METADATA,sha256=8mqQHNGklsOew5pf60DiJ2eFjHj9cCzPs8Sp0oSGenU,2696
12
- django_cte-2.0.0.dev20250616152647.dist-info/RECORD,,
9
+ django_cte-2.0.1.dev20251006182758.dist-info/licenses/LICENSE,sha256=mkLNw_QhpZ40jBEbuAosqH4ciA3KMrwb8aSYbTmy5gc,1508
10
+ django_cte-2.0.1.dev20251006182758.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
11
+ django_cte-2.0.1.dev20251006182758.dist-info/METADATA,sha256=5EiY1DAmbfQvAPxOjaBCuzEhNqlWbSqSK7Xv0QTYpbI,2646
12
+ django_cte-2.0.1.dev20251006182758.dist-info/RECORD,,