Ticket #12997: 12997-1.1.X-r13132.diff

File 12997-1.1.X-r13132.diff, 5.7 KB (added by Ramiro Morales, 14 years ago)

Patch for 1.1.X branch updated to apply cleanly as of now

  • docs/ref/models/querysets.txt

    diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
    a b  
    134134``filter(**kwargs)``
    135135~~~~~~~~~~~~~~~~~~~~
    136136
     137.. method:: filter(**kwargs)
     138
    137139Returns a new ``QuerySet`` containing objects that match the given lookup
    138140parameters.
    139141
     
    144146``exclude(**kwargs)``
    145147~~~~~~~~~~~~~~~~~~~~~
    146148
     149.. method:: exclude(**kwargs)
     150
    147151Returns a new ``QuerySet`` containing objects that do *not* match the given
    148152lookup parameters.
    149153
     
    177181``annotate(*args, **kwargs)``
    178182~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    179183
     184.. method:: annotate(*args, **kwargs)
     185
    180186.. versionadded:: 1.1
    181187
    182188Annotates each object in the ``QuerySet`` with the provided list of
     
    219225``order_by(*fields)``
    220226~~~~~~~~~~~~~~~~~~~~~
    221227
     228.. method:: order_by(*fields)
     229
    222230By default, results returned by a ``QuerySet`` are ordered by the ordering
    223231tuple given by the ``ordering`` option in the model's ``Meta``. You can
    224232override this on a per-``QuerySet`` basis by using the ``order_by`` method.
     
    293301``reverse()``
    294302~~~~~~~~~~~~~
    295303
     304.. method:: reverse()
     305
    296306.. versionadded:: 1.0
    297307
    298308Use the ``reverse()`` method to reverse the order in which a queryset's
     
    323333``distinct()``
    324334~~~~~~~~~~~~~~
    325335
     336.. method:: distinct()
     337
    326338Returns a new ``QuerySet`` that uses ``SELECT DISTINCT`` in its SQL query. This
    327339eliminates duplicate rows from the query results.
    328340
     
    357369``values(*fields)``
    358370~~~~~~~~~~~~~~~~~~~
    359371
     372.. method:: values(*fields)
     373
    360374Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that returns dictionaries when
    361375used as an iterable, rather than model-instance objects.
    362376
     
    440454``values_list(*fields)``
    441455~~~~~~~~~~~~~~~~~~~~~~~~
    442456
     457.. method:: values_list(*fields)
     458
    443459.. versionadded:: 1.0
    444460
    445461This is similar to ``values()`` except that instead of returning dictionaries,
     
    468484``dates(field, kind, order='ASC')``
    469485~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    470486
     487.. method:: dates(field, kind, order='ASC')
     488
    471489Returns a ``DateQuerySet`` -- a ``QuerySet`` that evaluates to a list of
    472490``datetime.datetime`` objects representing all available dates of a particular
    473491kind within the contents of the ``QuerySet``.
     
    502520``none()``
    503521~~~~~~~~~~
    504522
     523.. method:: none()
     524
    505525.. versionadded:: 1.0
    506526
    507527Returns an ``EmptyQuerySet`` -- a ``QuerySet`` that always evaluates to
     
    515535    []
    516536
    517537``all()``
    518 ~~~~~~~~~~
     538~~~~~~~~~
     539
     540.. method:: all()
    519541
    520542.. versionadded:: 1.0
    521543
     
    530552``select_related()``
    531553~~~~~~~~~~~~~~~~~~~~
    532554
     555.. method:: select_related()
     556
    533557Returns a ``QuerySet`` that will automatically "follow" foreign-key
    534558relationships, selecting that additional related-object data when it executes
    535559its query. This is a performance booster which results in (sometimes much)
     
    639663``extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)``
    640664~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    641665
     666.. method:: extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)
     667
    642668Sometimes, the Django query syntax by itself can't easily express a complex
    643669``WHERE`` clause. For these edge cases, Django provides the ``extra()``
    644670``QuerySet`` modifier -- a hook for injecting specific clauses into the SQL
     
    801827``defer(*fields)``
    802828~~~~~~~~~~~~~~~~~~
    803829
     830.. method:: defer(*fields)
     831
    804832.. versionadded:: 1.1
    805833
    806834In some complex data-modeling situations, your models might contain a lot of
     
    857885    settled down and you understand where the hot-points are.
    858886
    859887``only(*fields)``
    860 ~~~~~~~~~~~~~~~~~~
     888~~~~~~~~~~~~~~~~~
     889
     890.. method:: only(*fields)
    861891
    862892.. versionadded:: 1.1
    863893
     
    907937``get(**kwargs)``
    908938~~~~~~~~~~~~~~~~~
    909939
     940.. method:: get(**kwargs)
     941
    910942Returns the object matching the given lookup parameters, which should be in
    911943the format described in `Field lookups`_.
    912944
     
    934966``create(**kwargs)``
    935967~~~~~~~~~~~~~~~~~~~~
    936968
     969.. method:: create(**kwargs)
     970
    937971A convenience method for creating an object and saving it all in one step.  Thus::
    938972
    939973    p = Person.objects.create(first_name="Bruce", last_name="Springsteen")
     
    956990``get_or_create(**kwargs)``
    957991~~~~~~~~~~~~~~~~~~~~~~~~~~~
    958992
     993.. method:: get_or_create(**kwargs)
     994
    959995A convenience method for looking up an object with the given kwargs, creating
    960996one if necessary.
    961997
     
    10241060``count()``
    10251061~~~~~~~~~~~
    10261062
     1063.. method:: count()
     1064
    10271065Returns an integer representing the number of objects in the database matching
    10281066the ``QuerySet``. ``count()`` never raises exceptions.
    10291067
     
    10471085``in_bulk(id_list)``
    10481086~~~~~~~~~~~~~~~~~~~~
    10491087
     1088.. method:: in_bulk(id_list)
     1089
    10501090Takes a list of primary-key values and returns a dictionary mapping each
    10511091primary-key value to an instance of the object with the given ID.
    10521092
     
    10661106``iterator()``
    10671107~~~~~~~~~~~~~~
    10681108
     1109.. method:: iterator()
     1110
    10691111Evaluates the ``QuerySet`` (by performing the query) and returns an
    10701112`iterator`_ over the results. A ``QuerySet`` typically caches its
    10711113results internally so that repeated evaluations do not result in
     
    10821124``latest(field_name=None)``
    10831125~~~~~~~~~~~~~~~~~~~~~~~~~~~
    10841126
     1127.. method:: latest(field_name=None)
     1128
    10851129Returns the latest object in the table, by date, using the ``field_name``
    10861130provided as the date field.
    10871131
     
    11021146``aggregate(*args, **kwargs)``
    11031147~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    11041148
     1149.. method:: aggregate(*args, **kwargs)
     1150
    11051151.. versionadded:: 1.1
    11061152
    11071153Returns a dictionary of aggregate values (averages, sums, etc) calculated
     
    13301376
    13311377    SELECT ... WHERE id > 4;
    13321378
    1333 .. fieldlookup:: gte 
     1379.. fieldlookup:: gte
    13341380
    13351381gte
    13361382~~~
Back to Top