diff options
Diffstat (limited to 'docs/ref/models')
| -rw-r--r-- | docs/ref/models/fields.txt | 3 | ||||
| -rw-r--r-- | docs/ref/models/querysets.txt | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index d322904ec9..99ba78cb09 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -287,6 +287,9 @@ For example, if you have a field ``title`` that has ``unique_for_date="pub_date"``, then Django wouldn't allow the entry of two records with the same ``title`` and ``pub_date``. +Note that if you set this to point to a :class:`DateTimeField`, only the date +portion of the field will be considered. + This is enforced by model validation but not at the database level. ``unique_for_month`` diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index d27214a66c..ffada19082 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -328,7 +328,7 @@ Use the ``reverse()`` method to reverse the order in which a queryset's elements are returned. Calling ``reverse()`` a second time restores the ordering back to the normal direction. -To retrieve the ''last'' five items in a queryset, you could do this:: +To retrieve the "last" five items in a queryset, you could do this:: my_queryset.reverse()[:5] @@ -1486,7 +1486,7 @@ internally so that repeated evaluations do not result in additional queries. In contrast, ``iterator()`` will read results directly, without doing any caching at the ``QuerySet`` level (internally, the default iterator calls ``iterator()`` and caches the return value). For a ``QuerySet`` which returns a large number of -objects that you only need to access once, this can results in better +objects that you only need to access once, this can result in better performance and a significant reduction in memory. Note that using ``iterator()`` on a ``QuerySet`` which has already been |
