Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed `fieldlookup` docs cross-reference directive, and added it to t…

…he queryset reference. Refs #12930.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12808 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d58020fce8019e3a9df717e0a78a9833c85094b7 1 parent f081059
Justin Bronn authored March 20, 2010
2  docs/_ext/djangodocs.py
@@ -38,7 +38,7 @@ def setup(app):
38 38
     app.add_crossref_type(
39 39
         directivename = "fieldlookup",
40 40
         rolename      = "lookup",
41  
-        indextemplate = "pair: %s, field lookup type",
  41
+        indextemplate = "pair: %s; field lookup type",
42 42
     )
43 43
     app.add_description_unit(
44 44
         directivename = "django-admin",
44  docs/ref/models/querysets.txt
@@ -1191,6 +1191,8 @@ specified as keyword arguments to the ``QuerySet`` methods ``filter()``,
1191 1191
 
1192 1192
 For an introduction, see :ref:`field-lookups-intro`.
1193 1193
 
  1194
+.. fieldlookup:: exact
  1195
+
1194 1196
 exact
1195 1197
 ~~~~~
1196 1198
 
@@ -1222,6 +1224,8 @@ SQL equivalents::
1222 1224
     information about this, see the :ref:`collation section <mysql-collation>`
1223 1225
     in the :ref:`databases <ref-databases>` documentation.
1224 1226
 
  1227
+.. fieldlookup:: iexact
  1228
+
1225 1229
 iexact
1226 1230
 ~~~~~~
1227 1231
 
@@ -1245,6 +1249,8 @@ BLoG'``, etc.
1245 1249
     comparisons. SQLite does not do case-insensitive matching for Unicode
1246 1250
     strings.
1247 1251
 
  1252
+.. fieldlookup:: contains
  1253
+
1248 1254
 contains
1249 1255
 ~~~~~~~~
1250 1256
 
@@ -1264,6 +1270,8 @@ Note this will match the headline ``'Today Lennon honored'`` but not
1264 1270
 SQLite doesn't support case-sensitive ``LIKE`` statements; ``contains`` acts
1265 1271
 like ``icontains`` for SQLite.
1266 1272
 
  1273
+.. fieldlookup:: icontains
  1274
+
1267 1275
 icontains
1268 1276
 ~~~~~~~~~
1269 1277
 
@@ -1283,6 +1291,8 @@ SQL equivalent::
1283 1291
     mind the :ref:`database note <sqlite-string-matching>` about string
1284 1292
     comparisons.
1285 1293
 
  1294
+.. fieldlookup:: in
  1295
+
1286 1296
 in
1287 1297
 ~~
1288 1298
 
@@ -1358,6 +1368,8 @@ extract two field values, where only one is expected::
1358 1368
     the first query. Without it, a nested query would be executed, because
1359 1369
     :ref:`querysets-are-lazy`.
1360 1370
 
  1371
+.. fieldlookup:: gt
  1372
+
1361 1373
 gt
1362 1374
 ~~
1363 1375
 
@@ -1371,21 +1383,29 @@ SQL equivalent::
1371 1383
 
1372 1384
     SELECT ... WHERE id > 4;
1373 1385
 
  1386
+.. fieldlookup:: gte 
  1387
+
1374 1388
 gte
1375 1389
 ~~~
1376 1390
 
1377 1391
 Greater than or equal to.
1378 1392
 
  1393
+.. fieldlookup:: lt
  1394
+
1379 1395
 lt
1380 1396
 ~~
1381 1397
 
1382 1398
 Less than.
1383 1399
 
  1400
+.. fieldlookup:: lte
  1401
+
1384 1402
 lte
1385 1403
 ~~~
1386 1404
 
1387 1405
 Less than or equal to.
1388 1406
 
  1407
+.. fieldlookup:: startswith
  1408
+
1389 1409
 startswith
1390 1410
 ~~~~~~~~~~
1391 1411
 
@@ -1402,6 +1422,8 @@ SQL equivalent::
1402 1422
 SQLite doesn't support case-sensitive ``LIKE`` statements; ``startswith`` acts
1403 1423
 like ``istartswith`` for SQLite.
1404 1424
 
  1425
+.. fieldlookup:: istartswith
  1426
+
1405 1427
 istartswith
1406 1428
 ~~~~~~~~~~~
1407 1429
 
@@ -1421,6 +1443,8 @@ SQL equivalent::
1421 1443
     mind the :ref:`database note <sqlite-string-matching>` about string
1422 1444
     comparisons.
1423 1445
 
  1446
+.. fieldlookup:: endswith
  1447
+
1424 1448
 endswith
1425 1449
 ~~~~~~~~
1426 1450
 
@@ -1437,6 +1461,8 @@ SQL equivalent::
1437 1461
 SQLite doesn't support case-sensitive ``LIKE`` statements; ``endswith`` acts
1438 1462
 like ``iendswith`` for SQLite.
1439 1463
 
  1464
+.. fieldlookup:: iendswith
  1465
+
1440 1466
 iendswith
1441 1467
 ~~~~~~~~~
1442 1468
 
@@ -1456,6 +1482,8 @@ SQL equivalent::
1456 1482
     mind the :ref:`database note <sqlite-string-matching>` about string
1457 1483
     comparisons.
1458 1484
 
  1485
+.. fieldlookup:: range
  1486
+
1459 1487
 range
1460 1488
 ~~~~~
1461 1489
 
@@ -1474,6 +1502,8 @@ SQL equivalent::
1474 1502
 You can use ``range`` anywhere you can use ``BETWEEN`` in SQL -- for dates,
1475 1503
 numbers and even characters.
1476 1504
 
  1505
+.. fieldlookup:: year
  1506
+
1477 1507
 year
1478 1508
 ~~~~
1479 1509
 
@@ -1489,6 +1519,8 @@ SQL equivalent::
1489 1519
 
1490 1520
 (The exact SQL syntax varies for each database engine.)
1491 1521
 
  1522
+.. fieldlookup:: month
  1523
+
1492 1524
 month
1493 1525
 ~~~~~
1494 1526
 
@@ -1505,6 +1537,8 @@ SQL equivalent::
1505 1537
 
1506 1538
 (The exact SQL syntax varies for each database engine.)
1507 1539
 
  1540
+.. fieldlookup:: day
  1541
+
1508 1542
 day
1509 1543
 ~~~
1510 1544
 
@@ -1523,6 +1557,8 @@ SQL equivalent::
1523 1557
 Note this will match any record with a pub_date on the third day of the month,
1524 1558
 such as January 3, July 3, etc.
1525 1559
 
  1560
+.. fieldlookup:: week_day
  1561
+
1526 1562
 week_day
1527 1563
 ~~~~~~~~
1528 1564
 
@@ -1544,6 +1580,8 @@ Note this will match any record with a pub_date that falls on a Monday (day 2
1544 1580
 of the week), regardless of the month or year in which it occurs. Week days
1545 1581
 are indexed with day 1 being Sunday and day 7 being Saturday.
1546 1582
 
  1583
+.. fieldlookup:: isnull
  1584
+
1547 1585
 isnull
1548 1586
 ~~~~~~
1549 1587
 
@@ -1558,6 +1596,8 @@ SQL equivalent::
1558 1596
 
1559 1597
     SELECT ... WHERE pub_date IS NULL;
1560 1598
 
  1599
+.. fieldlookup:: search
  1600
+
1561 1601
 search
1562 1602
 ~~~~~~
1563 1603
 
@@ -1577,6 +1617,8 @@ database to add the full-text index. By default Django uses BOOLEAN MODE for
1577 1617
 full text searches. `Please check MySQL documentation for additional details. <http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html>`_
1578 1618
 
1579 1619
 
  1620
+.. fieldlookup:: regex
  1621
+
1580 1622
 regex
1581 1623
 ~~~~~
1582 1624
 
@@ -1606,6 +1648,8 @@ SQL equivalents::
1606 1648
 Using raw strings (e.g., ``r'foo'`` instead of ``'foo'``) for passing in the
1607 1649
 regular expression syntax is recommended.
1608 1650
 
  1651
+.. fieldlookup:: iregex
  1652
+
1609 1653
 iregex
1610 1654
 ~~~~~~
1611 1655
 

0 notes on commit d58020f

Please sign in to comment.
Something went wrong with that request. Please try again.