Django

Code

Changeset 2810

Show
Ignore:
Timestamp:
05/01/06 20:55:25 (2 years ago)
Author:
adrian
Message:

Fixed some ReST errors in docs/db-api.txt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/db-api.txt

    r2809 r2810  
    8282`AutoField documentation`_.) 
    8383 
    84 .. _AutoField documentation: TODO: Link 
     84.. _AutoField documentation: http://www.djangoproject.com/documentation/model_api/#autofield 
    8585 
    8686Explicitly specifying auto-primary-key values 
     
    322322executed. 
    323323 
    324 filter(**kwargs) 
    325 ~~~~~~~~~~~~~~~~ 
     324``filter(**kwargs)`` 
     325~~~~~~~~~~~~~~~~~~~~ 
    326326 
    327327Returns a new ``QuerySet`` containing objects that match the given lookup 
     
    332332underlying SQL statement. 
    333333 
    334 exclude(**kwargs) 
    335 ~~~~~~~~~~~~~~~~~ 
     334``exclude(**kwargs)`` 
     335~~~~~~~~~~~~~~~~~~~~~ 
    336336 
    337337Returns a new ``QuerySet`` containing objects that do *not* match the given 
     
    365365Note the second example is more restrictive. 
    366366 
    367 order_by(*fields) 
    368 ~~~~~~~~~~~~~~~~~ 
     367``order_by(*fields)`` 
     368~~~~~~~~~~~~~~~~~~~~~ 
    369369 
    370370By default, results returned by a ``QuerySet`` are ordered by the ordering 
     
    392392backend normally orders them. 
    393393 
    394 distinct() 
    395 ~~~~~~~~~~ 
     394``distinct()`` 
     395~~~~~~~~~~~~~~ 
    396396 
    397397Returns a new ``QuerySet`` that uses ``SELECT DISTINCT`` in its SQL query. This 
     
    405405results when a ``QuerySet`` is evaluated. That's when you'd use ``distinct()``. 
    406406 
    407 values(*fields) 
    408 ~~~~~~~~~~~~~~~ 
     407``values(*fields)`` 
     408~~~~~~~~~~~~~~~~~~~ 
    409409 
    410410Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that evaluates to a list of 
     
    455455individualism. 
    456456 
    457 dates(field, kind, order='ASC') 
    458 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     457``dates(field, kind, order='ASC')`` 
     458~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    459459 
    460460Returns a ``DateQuerySet`` -- a ``QuerySet`` that evaluates to a list of 
     
    489489    [datetime.datetime(2005, 3, 20)] 
    490490 
    491 select_related() 
    492 ~~~~~~~~~~~~~~~~ 
     491``select_related()`` 
     492~~~~~~~~~~~~~~~~~~~~ 
    493493 
    494494Returns a ``QuerySet`` that will automatically "follow" foreign-key 
     
    541541    c = p.hometown       # Hits the database. 
    542542 
    543 extra(select=None, where=None, params=None, tables=None) 
    544 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     543``extra(select=None, where=None, params=None, tables=None)`` 
     544~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    545545 
    546546Sometimes, the Django query syntax by itself can't easily express a complex 
     
    647647they query the database each time they're called. 
    648648 
    649 get(**kwargs) 
    650 ~~~~~~~~~~~~~ 
     649``get(**kwargs)`` 
     650~~~~~~~~~~~~~~~~~ 
    651651 
    652652Returns the object matching the given lookup parameters, which should be in 
     
    672672        print "Either the entry or blog doesn't exist." 
    673673 
    674 count() 
    675 ~~~~~~~ 
     674``count()`` 
     675~~~~~~~~~~~ 
    676676 
    677677Returns an integer representing the number of objects in the database matching 
     
    695695problems. 
    696696 
    697 in_bulk(id_list) 
    698 ~~~~~~~~~~~~~~~~ 
     697``in_bulk(id_list)`` 
     698~~~~~~~~~~~~~~~~~~~~ 
    699699 
    700700Takes a list of primary-key values and returns a dictionary mapping each 
     
    712712If you pass ``in_bulk()`` an empty list, you'll get an empty dictionary. 
    713713 
    714 latest(field_name=None) 
    715 ~~~~~~~~~~~~~~~~~~~~~~~ 
     714``latest(field_name=None)`` 
     715~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    716716 
    717717Returns the latest object in the table, by date, using the ``field_name`` 
     
    11061106    some_obj == other_obj 
    11071107    some_obj.name == other_obj.name 
    1108  
    1109  
    1110  
    1111  
    1112 ======================================== 
    1113 THE REST OF THIS HAS NOT YET BEEN EDITED 
    1114 ======================================== 
    1115  
    11161108 
    11171109OR lookups