Changeset 2810
- Timestamp:
- 05/01/06 20:55:25 (2 years ago)
- Files:
-
- django/trunk/docs/db-api.txt (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/db-api.txt
r2809 r2810 82 82 `AutoField documentation`_.) 83 83 84 .. _AutoField documentation: TODO: Link84 .. _AutoField documentation: http://www.djangoproject.com/documentation/model_api/#autofield 85 85 86 86 Explicitly specifying auto-primary-key values … … 322 322 executed. 323 323 324 filter(**kwargs) 325 ~~~~~~~~~~~~~~~~ 324 ``filter(**kwargs)`` 325 ~~~~~~~~~~~~~~~~~~~~ 326 326 327 327 Returns a new ``QuerySet`` containing objects that match the given lookup … … 332 332 underlying SQL statement. 333 333 334 exclude(**kwargs) 335 ~~~~~~~~~~~~~~~~~ 334 ``exclude(**kwargs)`` 335 ~~~~~~~~~~~~~~~~~~~~~ 336 336 337 337 Returns a new ``QuerySet`` containing objects that do *not* match the given … … 365 365 Note the second example is more restrictive. 366 366 367 order_by(*fields) 368 ~~~~~~~~~~~~~~~~~ 367 ``order_by(*fields)`` 368 ~~~~~~~~~~~~~~~~~~~~~ 369 369 370 370 By default, results returned by a ``QuerySet`` are ordered by the ordering … … 392 392 backend normally orders them. 393 393 394 distinct() 395 ~~~~~~~~~~ 394 ``distinct()`` 395 ~~~~~~~~~~~~~~ 396 396 397 397 Returns a new ``QuerySet`` that uses ``SELECT DISTINCT`` in its SQL query. This … … 405 405 results when a ``QuerySet`` is evaluated. That's when you'd use ``distinct()``. 406 406 407 values(*fields) 408 ~~~~~~~~~~~~~~~ 407 ``values(*fields)`` 408 ~~~~~~~~~~~~~~~~~~~ 409 409 410 410 Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that evaluates to a list of … … 455 455 individualism. 456 456 457 dates(field, kind, order='ASC') 458 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 457 ``dates(field, kind, order='ASC')`` 458 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 459 459 460 460 Returns a ``DateQuerySet`` -- a ``QuerySet`` that evaluates to a list of … … 489 489 [datetime.datetime(2005, 3, 20)] 490 490 491 select_related() 492 ~~~~~~~~~~~~~~~~ 491 ``select_related()`` 492 ~~~~~~~~~~~~~~~~~~~~ 493 493 494 494 Returns a ``QuerySet`` that will automatically "follow" foreign-key … … 541 541 c = p.hometown # Hits the database. 542 542 543 extra(select=None, where=None, params=None, tables=None) 544 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 543 ``extra(select=None, where=None, params=None, tables=None)`` 544 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 545 545 546 546 Sometimes, the Django query syntax by itself can't easily express a complex … … 647 647 they query the database each time they're called. 648 648 649 get(**kwargs) 650 ~~~~~~~~~~~~~ 649 ``get(**kwargs)`` 650 ~~~~~~~~~~~~~~~~~ 651 651 652 652 Returns the object matching the given lookup parameters, which should be in … … 672 672 print "Either the entry or blog doesn't exist." 673 673 674 count() 675 ~~~~~~~ 674 ``count()`` 675 ~~~~~~~~~~~ 676 676 677 677 Returns an integer representing the number of objects in the database matching … … 695 695 problems. 696 696 697 in_bulk(id_list) 698 ~~~~~~~~~~~~~~~~ 697 ``in_bulk(id_list)`` 698 ~~~~~~~~~~~~~~~~~~~~ 699 699 700 700 Takes a list of primary-key values and returns a dictionary mapping each … … 712 712 If you pass ``in_bulk()`` an empty list, you'll get an empty dictionary. 713 713 714 latest(field_name=None) 715 ~~~~~~~~~~~~~~~~~~~~~~~ 714 ``latest(field_name=None)`` 715 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 716 716 717 717 Returns the latest object in the table, by date, using the ``field_name`` … … 1106 1106 some_obj == other_obj 1107 1107 some_obj.name == other_obj.name 1108 1109 1110 1111 1112 ========================================1113 THE REST OF THIS HAS NOT YET BEEN EDITED1114 ========================================1115 1116 1108 1117 1109 OR lookups
