Fixed #25382 -- Removed obsolete references to DateQuerySet.
This commit is contained in:
parent
fba8655e88
commit
e3720b990a
|
@ -48,11 +48,9 @@ ArchiveIndexView
|
||||||
:class:`django.views.generic.dates.BaseDateListView`), the template's
|
:class:`django.views.generic.dates.BaseDateListView`), the template's
|
||||||
context will be:
|
context will be:
|
||||||
|
|
||||||
* ``date_list``: A
|
* ``date_list``: A :meth:`QuerySet <django.db.models.query.QuerySet.dates>`
|
||||||
:meth:`DateQuerySet<django.db.models.query.QuerySet.dates>` object
|
object containing all years that have objects available according to
|
||||||
containing all years that have objects available according to
|
``queryset``, represented as :class:`datetime.datetime` objects, in
|
||||||
``queryset``, represented as
|
|
||||||
:class:`datetime.datetime<python:datetime.datetime>` objects, in
|
|
||||||
descending order.
|
descending order.
|
||||||
|
|
||||||
**Notes**
|
**Notes**
|
||||||
|
@ -128,11 +126,9 @@ YearArchiveView
|
||||||
:class:`django.views.generic.dates.BaseDateListView`), the template's
|
:class:`django.views.generic.dates.BaseDateListView`), the template's
|
||||||
context will be:
|
context will be:
|
||||||
|
|
||||||
* ``date_list``: A
|
* ``date_list``: A :meth:`QuerySet <django.db.models.query.QuerySet.dates>`
|
||||||
:meth:`DateQuerySet<django.db.models.query.QuerySet.dates>` object
|
object containing all months that have objects available according to
|
||||||
containing all months that have objects available according to
|
``queryset``, represented as :class:`datetime.datetime` objects, in
|
||||||
``queryset``, represented as
|
|
||||||
:class:`datetime.datetime<python:datetime.datetime>` objects, in
|
|
||||||
ascending order.
|
ascending order.
|
||||||
|
|
||||||
* ``year``: A :class:`~datetime.date` object
|
* ``year``: A :class:`~datetime.date` object
|
||||||
|
@ -223,12 +219,10 @@ MonthArchiveView
|
||||||
:class:`~django.views.generic.dates.BaseDateListView`), the template's
|
:class:`~django.views.generic.dates.BaseDateListView`), the template's
|
||||||
context will be:
|
context will be:
|
||||||
|
|
||||||
* ``date_list``: A
|
* ``date_list``: A :meth:`QuerySet <django.db.models.query.QuerySet.dates>`
|
||||||
:meth:`DateQuerySet<django.db.models.query.QuerySet.dates>` object
|
object containing all days that have objects available in the given month,
|
||||||
containing all days that have objects available in the given month,
|
according to ``queryset``, represented as :class:`datetime.datetime`
|
||||||
according to ``queryset``, represented as
|
objects, in ascending order.
|
||||||
:class:`datetime.datetime<python:datetime.datetime>` objects, in
|
|
||||||
ascending order.
|
|
||||||
|
|
||||||
* ``month``: A :class:`~datetime.date` object
|
* ``month``: A :class:`~datetime.date` object
|
||||||
representing the given month.
|
representing the given month.
|
||||||
|
|
|
@ -646,9 +646,9 @@ dates
|
||||||
|
|
||||||
.. method:: dates(field, kind, order='ASC')
|
.. method:: dates(field, kind, order='ASC')
|
||||||
|
|
||||||
Returns a ``DateQuerySet`` — a ``QuerySet`` that evaluates to a list of
|
Returns a ``QuerySet`` that evaluates to a list of :class:`datetime.date`
|
||||||
:class:`datetime.date` objects representing all available dates of a
|
objects representing all available dates of a particular kind within the
|
||||||
particular kind within the contents of the ``QuerySet``.
|
contents of the ``QuerySet``.
|
||||||
|
|
||||||
``field`` should be the name of a ``DateField`` of your model.
|
``field`` should be the name of a ``DateField`` of your model.
|
||||||
``kind`` should be either ``"year"``, ``"month"`` or ``"day"``. Each
|
``kind`` should be either ``"year"``, ``"month"`` or ``"day"``. Each
|
||||||
|
|
|
@ -670,7 +670,7 @@ class AggregationTests(TestCase):
|
||||||
lambda b: b.name
|
lambda b: b.name
|
||||||
)
|
)
|
||||||
|
|
||||||
# Regression for #10248 - Annotations work with DateQuerySets
|
# Regression for #10248 - Annotations work with dates()
|
||||||
qs = Book.objects.annotate(num_authors=Count('authors')).filter(num_authors=2).dates('pubdate', 'day')
|
qs = Book.objects.annotate(num_authors=Count('authors')).filter(num_authors=2).dates('pubdate', 'day')
|
||||||
self.assertQuerysetEqual(
|
self.assertQuerysetEqual(
|
||||||
qs, [
|
qs, [
|
||||||
|
|
|
@ -751,7 +751,7 @@ class Queries1Tests(BaseQuerysetTest):
|
||||||
3
|
3
|
||||||
)
|
)
|
||||||
|
|
||||||
# Pickling of DateQuerySets used to fail
|
# Pickling of QuerySets using datetimes() should work.
|
||||||
qs = Item.objects.datetimes('created', 'month')
|
qs = Item.objects.datetimes('created', 'month')
|
||||||
pickle.loads(pickle.dumps(qs))
|
pickle.loads(pickle.dumps(qs))
|
||||||
|
|
||||||
|
@ -1302,8 +1302,8 @@ class Queries3Tests(BaseQuerysetTest):
|
||||||
self.assertQuerysetEqual(Valid.objects.all(), [])
|
self.assertQuerysetEqual(Valid.objects.all(), [])
|
||||||
|
|
||||||
def test_ticket8683(self):
|
def test_ticket8683(self):
|
||||||
# Raise proper error when a DateQuerySet gets passed a wrong type of
|
# An error should be raised when QuerySet.datetimes() is passed the
|
||||||
# field
|
# wrong type of field.
|
||||||
self.assertRaisesMessage(
|
self.assertRaisesMessage(
|
||||||
AssertionError,
|
AssertionError,
|
||||||
"'name' isn't a DateTimeField.",
|
"'name' isn't a DateTimeField.",
|
||||||
|
|
Loading…
Reference in New Issue