Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added note to docs/db-api.txt about using distinct=True with get_valu…

…es()

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1786 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit bf5125734ebb9148eb455c05dbc872876f91e2b8 1 parent de72616
@adrianholovaty adrianholovaty authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 docs/db-api.txt
View
6 docs/db-api.txt
@@ -398,7 +398,11 @@ which rows are returned. Both ``limit`` and ``offset`` should be integers which
will be directly passed to the SQL ``LIMIT``/``OFFSET`` commands.
If ``distinct`` is True, only distinct rows will be returned. This is equivalent
-to a ``SELECT DISTINCT`` SQL clause.
+to a ``SELECT DISTINCT`` SQL clause. You can use this with ``get_values()`` to
+get distinct values. For example, this returns the distinct first_names::
+
+ >>> people.get_values(fields=['first_name'], distinct=True)
+ [{'first_name': 'Adrian'}, {'first_name': 'Jacob'}, {'first_name': 'Simon'}]
Other lookup options
====================
Please sign in to comment.
Something went wrong with that request. Please try again.