Ticket #12997: 12997-r12842.diff

File 12997-r12842.diff, 5.9 KB (added by Ramiro Morales, 15 years ago)

Patch updated wiht some missed methods, updated to r12842 and modified to no remove the title markup.

  • docs/ref/models/querysets.txt

    diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
    a b  
    138138``filter(**kwargs)``
    139139~~~~~~~~~~~~~~~~~~~~
    140140
     141.. method:: filter(**kwargs)
     142
    141143Returns a new ``QuerySet`` containing objects that match the given lookup
    142144parameters.
    143145
     
    148150``exclude(**kwargs)``
    149151~~~~~~~~~~~~~~~~~~~~~
    150152
     153.. method:: exclude(**kwargs)
     154
    151155Returns a new ``QuerySet`` containing objects that do *not* match the given
    152156lookup parameters.
    153157
     
    181185``annotate(*args, **kwargs)``
    182186~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    183187
     188.. method:: annotate(*args, **kwargs)
     189
    184190.. versionadded:: 1.1
    185191
    186192Annotates each object in the ``QuerySet`` with the provided list of
     
    223229``order_by(*fields)``
    224230~~~~~~~~~~~~~~~~~~~~~
    225231
     232.. method:: order_by(*fields)
     233
    226234By default, results returned by a ``QuerySet`` are ordered by the ordering
    227235tuple given by the ``ordering`` option in the model's ``Meta``. You can
    228236override this on a per-``QuerySet`` basis by using the ``order_by`` method.
     
    297305``reverse()``
    298306~~~~~~~~~~~~~
    299307
     308.. method:: reverse()
     309
    300310.. versionadded:: 1.0
    301311
    302312Use the ``reverse()`` method to reverse the order in which a queryset's
     
    327337``distinct()``
    328338~~~~~~~~~~~~~~
    329339
     340.. method:: distinct()
     341
    330342Returns a new ``QuerySet`` that uses ``SELECT DISTINCT`` in its SQL query. This
    331343eliminates duplicate rows from the query results.
    332344
     
    361373``values(*fields)``
    362374~~~~~~~~~~~~~~~~~~~
    363375
     376.. method:: values(*fields)
     377
    364378Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that returns dictionaries when
    365379used as an iterable, rather than model-instance objects.
    366380
     
    444458``values_list(*fields)``
    445459~~~~~~~~~~~~~~~~~~~~~~~~
    446460
     461.. method:: values_list(*fields)
     462
    447463.. versionadded:: 1.0
    448464
    449465This is similar to ``values()`` except that instead of returning dictionaries,
     
    472488``dates(field, kind, order='ASC')``
    473489~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    474490
     491.. method:: dates(field, kind, order='ASC')
     492
    475493Returns a ``DateQuerySet`` -- a ``QuerySet`` that evaluates to a list of
    476494``datetime.datetime`` objects representing all available dates of a particular
    477495kind within the contents of the ``QuerySet``.
     
    506524``none()``
    507525~~~~~~~~~~
    508526
     527.. method:: none()
     528
    509529.. versionadded:: 1.0
    510530
    511531Returns an ``EmptyQuerySet`` -- a ``QuerySet`` that always evaluates to
     
    519539    []
    520540
    521541``all()``
    522 ~~~~~~~~~~
     542~~~~~~~~~
     543
     544.. method:: all()
    523545
    524546.. versionadded:: 1.0
    525547
     
    534556``select_related()``
    535557~~~~~~~~~~~~~~~~~~~~
    536558
     559.. method:: select_related()
     560
    537561Returns a ``QuerySet`` that will automatically "follow" foreign-key
    538562relationships, selecting that additional related-object data when it executes
    539563its query. This is a performance booster which results in (sometimes much)
     
    655679``extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)``
    656680~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    657681
     682.. method:: extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)
     683
    658684Sometimes, the Django query syntax by itself can't easily express a complex
    659685``WHERE`` clause. For these edge cases, Django provides the ``extra()``
    660686``QuerySet`` modifier -- a hook for injecting specific clauses into the SQL
     
    817843``defer(*fields)``
    818844~~~~~~~~~~~~~~~~~~
    819845
     846.. method:: defer(*fields)
     847
    820848.. versionadded:: 1.1
    821849
    822850In some complex data-modeling situations, your models might contain a lot of
     
    873901    settled down and you understand where the hot-points are.
    874902
    875903``only(*fields)``
    876 ~~~~~~~~~~~~~~~~~~
     904~~~~~~~~~~~~~~~~~
     905
     906.. method:: only(*fields)
    877907
    878908.. versionadded:: 1.1
    879909
     
    909939    Entry.objects.defer("body").only("headline", "body")
    910940
    911941``using(alias)``
    912 ~~~~~~~~~~~~~~~~~~
     942~~~~~~~~~~~~~~~~
     943
     944.. method:: using(alias)
    913945
    914946.. versionadded:: 1.2
    915947
     
    941973``get(**kwargs)``
    942974~~~~~~~~~~~~~~~~~
    943975
     976.. method:: get(**kwargs)
     977
    944978Returns the object matching the given lookup parameters, which should be in
    945979the format described in `Field lookups`_.
    946980
     
    9681002``create(**kwargs)``
    9691003~~~~~~~~~~~~~~~~~~~~
    9701004
     1005.. method:: create(**kwargs)
     1006
    9711007A convenience method for creating an object and saving it all in one step.  Thus::
    9721008
    9731009    p = Person.objects.create(first_name="Bruce", last_name="Springsteen")
     
    9901026``get_or_create(**kwargs)``
    9911027~~~~~~~~~~~~~~~~~~~~~~~~~~~
    9921028
     1029.. method:: get_or_create(**kwargs)
     1030
    9931031A convenience method for looking up an object with the given kwargs, creating
    9941032one if necessary.
    9951033
     
    10581096``count()``
    10591097~~~~~~~~~~~
    10601098
     1099.. method:: count()
     1100
    10611101Returns an integer representing the number of objects in the database matching
    10621102the ``QuerySet``. ``count()`` never raises exceptions.
    10631103
     
    10821122``in_bulk(id_list)``
    10831123~~~~~~~~~~~~~~~~~~~~
    10841124
     1125.. method:: in_bulk(id_list)
     1126
    10851127Takes a list of primary-key values and returns a dictionary mapping each
    10861128primary-key value to an instance of the object with the given ID.
    10871129
     
    11011143``iterator()``
    11021144~~~~~~~~~~~~~~
    11031145
     1146.. method:: iterator()
     1147
    11041148Evaluates the ``QuerySet`` (by performing the query) and returns an
    11051149`iterator`_ over the results. A ``QuerySet`` typically caches its
    11061150results internally so that repeated evaluations do not result in
     
    11171161``latest(field_name=None)``
    11181162~~~~~~~~~~~~~~~~~~~~~~~~~~~
    11191163
     1164.. method:: latest(field_name=None)
     1165
    11201166Returns the latest object in the table, by date, using the ``field_name``
    11211167provided as the date field.
    11221168
     
    11371183``aggregate(*args, **kwargs)``
    11381184~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    11391185
     1186.. method:: aggregate(*args, **kwargs)
     1187
    11401188.. versionadded:: 1.1
    11411189
    11421190Returns a dictionary of aggregate values (averages, sums, etc) calculated
     
    11691217``exists()``
    11701218~~~~~~~~~~~~
    11711219
     1220.. method:: exists()
     1221
    11721222.. versionadded:: 1.2
    11731223
    11741224Returns ``True`` if the :class:`QuerySet` contains any results, and ``False``
Back to Top