Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.1.X] Fixed `fieldlookup` docs cross-reference directive, and added…

… it to the queryset reference. Refs #12930.

Backport of r12808 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6943950dfda48d2ca4e15f4367da24b0ead9aefd 1 parent 9d5fb83
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
@@ -1142,6 +1142,8 @@ specified as keyword arguments to the ``QuerySet`` methods ``filter()``,
1142 1142
 
1143 1143
 For an introduction, see :ref:`field-lookups-intro`.
1144 1144
 
  1145
+.. fieldlookup:: exact
  1146
+
1145 1147
 exact
1146 1148
 ~~~~~
1147 1149
 
@@ -1173,6 +1175,8 @@ SQL equivalents::
1173 1175
     information about this, see the :ref:`collation section <mysql-collation>`
1174 1176
     in the :ref:`databases <ref-databases>` documentation.
1175 1177
 
  1178
+.. fieldlookup:: iexact
  1179
+
1176 1180
 iexact
1177 1181
 ~~~~~~
1178 1182
 
@@ -1196,6 +1200,8 @@ BLoG'``, etc.
1196 1200
     comparisons. SQLite does not do case-insensitive matching for Unicode
1197 1201
     strings.
1198 1202
 
  1203
+.. fieldlookup:: contains
  1204
+
1199 1205
 contains
1200 1206
 ~~~~~~~~
1201 1207
 
@@ -1215,6 +1221,8 @@ Note this will match the headline ``'Today Lennon honored'`` but not
1215 1221
 SQLite doesn't support case-sensitive ``LIKE`` statements; ``contains`` acts
1216 1222
 like ``icontains`` for SQLite.
1217 1223
 
  1224
+.. fieldlookup:: icontains
  1225
+
1218 1226
 icontains
1219 1227
 ~~~~~~~~~
1220 1228
 
@@ -1234,6 +1242,8 @@ SQL equivalent::
1234 1242
     mind the :ref:`database note <sqlite-string-matching>` about string
1235 1243
     comparisons.
1236 1244
 
  1245
+.. fieldlookup:: in
  1246
+
1237 1247
 in
1238 1248
 ~~
1239 1249
 
@@ -1305,6 +1315,8 @@ extract two field values, where only one is expected::
1305 1315
                 name__contains='Cheddar').values_list('pk', flat=True)
1306 1316
         entries = Entry.objects.filter(blog__in=values)
1307 1317
 
  1318
+.. fieldlookup:: gt
  1319
+
1308 1320
 gt
1309 1321
 ~~
1310 1322
 
@@ -1318,21 +1330,29 @@ SQL equivalent::
1318 1330
 
1319 1331
     SELECT ... WHERE id > 4;
1320 1332
 
  1333
+.. fieldlookup:: gte 
  1334
+
1321 1335
 gte
1322 1336
 ~~~
1323 1337
 
1324 1338
 Greater than or equal to.
1325 1339
 
  1340
+.. fieldlookup:: lt
  1341
+
1326 1342
 lt
1327 1343
 ~~
1328 1344
 
1329 1345
 Less than.
1330 1346
 
  1347
+.. fieldlookup:: lte
  1348
+
1331 1349
 lte
1332 1350
 ~~~
1333 1351
 
1334 1352
 Less than or equal to.
1335 1353
 
  1354
+.. fieldlookup:: startswith
  1355
+
1336 1356
 startswith
1337 1357
 ~~~~~~~~~~
1338 1358
 
@@ -1349,6 +1369,8 @@ SQL equivalent::
1349 1369
 SQLite doesn't support case-sensitive ``LIKE`` statements; ``startswith`` acts
1350 1370
 like ``istartswith`` for SQLite.
1351 1371
 
  1372
+.. fieldlookup:: istartswith
  1373
+
1352 1374
 istartswith
1353 1375
 ~~~~~~~~~~~
1354 1376
 
@@ -1368,6 +1390,8 @@ SQL equivalent::
1368 1390
     mind the :ref:`database note <sqlite-string-matching>` about string
1369 1391
     comparisons.
1370 1392
 
  1393
+.. fieldlookup:: endswith
  1394
+
1371 1395
 endswith
1372 1396
 ~~~~~~~~
1373 1397
 
@@ -1384,6 +1408,8 @@ SQL equivalent::
1384 1408
 SQLite doesn't support case-sensitive ``LIKE`` statements; ``endswith`` acts
1385 1409
 like ``iendswith`` for SQLite.
1386 1410
 
  1411
+.. fieldlookup:: iendswith
  1412
+
1387 1413
 iendswith
1388 1414
 ~~~~~~~~~
1389 1415
 
@@ -1403,6 +1429,8 @@ SQL equivalent::
1403 1429
     mind the :ref:`database note <sqlite-string-matching>` about string
1404 1430
     comparisons.
1405 1431
 
  1432
+.. fieldlookup:: range
  1433
+
1406 1434
 range
1407 1435
 ~~~~~
1408 1436
 
@@ -1421,6 +1449,8 @@ SQL equivalent::
1421 1449
 You can use ``range`` anywhere you can use ``BETWEEN`` in SQL -- for dates,
1422 1450
 numbers and even characters.
1423 1451
 
  1452
+.. fieldlookup:: year
  1453
+
1424 1454
 year
1425 1455
 ~~~~
1426 1456
 
@@ -1436,6 +1466,8 @@ SQL equivalent::
1436 1466
 
1437 1467
 (The exact SQL syntax varies for each database engine.)
1438 1468
 
  1469
+.. fieldlookup:: month
  1470
+
1439 1471
 month
1440 1472
 ~~~~~
1441 1473
 
@@ -1452,6 +1484,8 @@ SQL equivalent::
1452 1484
 
1453 1485
 (The exact SQL syntax varies for each database engine.)
1454 1486
 
  1487
+.. fieldlookup:: day
  1488
+
1455 1489
 day
1456 1490
 ~~~
1457 1491
 
@@ -1470,6 +1504,8 @@ SQL equivalent::
1470 1504
 Note this will match any record with a pub_date on the third day of the month,
1471 1505
 such as January 3, July 3, etc.
1472 1506
 
  1507
+.. fieldlookup:: week_day
  1508
+
1473 1509
 week_day
1474 1510
 ~~~~~~~~
1475 1511
 
@@ -1491,6 +1527,8 @@ Note this will match any record with a pub_date that falls on a Monday (day 2
1491 1527
 of the week), regardless of the month or year in which it occurs. Week days
1492 1528
 are indexed with day 1 being Sunday and day 7 being Saturday.
1493 1529
 
  1530
+.. fieldlookup:: isnull
  1531
+
1494 1532
 isnull
1495 1533
 ~~~~~~
1496 1534
 
@@ -1505,6 +1543,8 @@ SQL equivalent::
1505 1543
 
1506 1544
     SELECT ... WHERE pub_date IS NULL;
1507 1545
 
  1546
+.. fieldlookup:: search
  1547
+
1508 1548
 search
1509 1549
 ~~~~~~
1510 1550
 
@@ -1524,6 +1564,8 @@ database to add the full-text index. By default Django uses BOOLEAN MODE for
1524 1564
 full text searches. `Please check MySQL documentation for additional details. <http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html>`_
1525 1565
 
1526 1566
 
  1567
+.. fieldlookup:: regex
  1568
+
1527 1569
 regex
1528 1570
 ~~~~~
1529 1571
 
@@ -1553,6 +1595,8 @@ SQL equivalents::
1553 1595
 Using raw strings (e.g., ``r'foo'`` instead of ``'foo'``) for passing in the
1554 1596
 regular expression syntax is recommended.
1555 1597
 
  1598
+.. fieldlookup:: iregex
  1599
+
1556 1600
 iregex
1557 1601
 ~~~~~~
1558 1602
 

0 notes on commit 6943950

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