Commit Graph

125 Commits

Author SHA1 Message Date
Jacob Kaplan-Moss 4477f50f0b Added a "depth" argument to select_related() to control how many "levels" of relations select_related() is willing to follow (refs #3275).
Also added unit tests for select_related().

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4645 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-28 15:24:05 +00:00
Jacob Kaplan-Moss a419079347 Fixed #2264: the docs now mention that delete() cascades. Thanks, Ubernostrum
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4636 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-27 03:48:49 +00:00
Adrian Holovaty 13280259a8 Fixed #3283 -- Added support for empty QuerySets via none() method. Thanks for the patch, medhat
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4394 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-23 02:11:08 +00:00
Jacob Kaplan-Moss 023b863251 Oops -- reverted accidentally commited material from [4280]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4281 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-03 22:38:51 +00:00
Jacob Kaplan-Moss da9affa8f8 Fixed #3226: removed some pre-magic-removal-isms in settings docs. Thanks, ubernostrum.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4280 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-03 22:37:05 +00:00
Russell Keith-Magee e1c6e987d0 Fixed #2756 -- Modified the get_object_or_404/get_list_or_404 shortcuts to accept model managers as well as model classes. Thanks, Gary Wilson.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4275 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-03 14:16:58 +00:00
Russell Keith-Magee 94edd4b81f Fixed #3118 -- Fixed reversed logic in DBAPI regarding handling of empty PKs on save(). Thanks, Makoto Tsuyuki.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4221 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-17 14:17:11 +00:00
Russell Keith-Magee fbbbf8b9a1 Fixes #2737 -- Added code to allow None as a query value for __exact queries, raising an error otherwise. __exact=None is interpreted as the SQL 'value = NULL'. This fixes some minor problems with queries on unsaved objects with related object sets, and stops queries with a value of None being outright ignored (even if they reference an unknown attribute).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3902 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-10-14 02:48:05 +00:00
Russell Keith-Magee 0c41869e6c Made ``pk`` a generic expansion for the primary key, rather than just an expansion for __id__exact.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3826 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-25 13:49:01 +00:00
Malcolm Tredinnick e947fb2111 Fixed #2769 -- Applied some ReST formatting fixes. Thanks, ramiro.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3774 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-21 13:30:01 +00:00
Adrian Holovaty aa587cd977 Fixed ReST error in docs/db-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3567 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-12 05:31:31 +00:00
Adrian Holovaty a7f8984e6e Fixed #2465 -- Documented the fact that select_related doesn't follow null=True
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3511 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-01 21:45:57 +00:00
Russell Keith-Magee c431ade5f5 Refs #2217 -- Updated DB API docs to discuss filtering using objects rather than IDs. Second attempt - forgot to save before commit last time.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3302 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-09 03:53:11 +00:00
Russell Keith-Magee 88189399b1 Refs #2217 -- Updated DB API docs to discuss filtering using objects rather than IDs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3301 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-09 03:51:37 +00:00
Jacob Kaplan-Moss 48562965b9 Added {{{Manager.create()}}} method to create and save an object in a single step.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3217 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-27 20:36:25 +00:00
Adrian Holovaty c256dcd04b Fixed #2176 -- Fixed typo in docs/db-api.txt. Thanks, simon@lieschke.net
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3141 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-18 17:33:02 +00:00
Malcolm Tredinnick 97fedcc031 Fixed #2143 -- Changed a few places where the pre-magic-removal-merge syntax
was still being used in the docs. Thanks to mssnlayam@yahoo.com for the patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3125 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-14 03:31:34 +00:00
Adrian Holovaty d028f891c9 Added section to docs/db-api.txt get_or_create() section about GET vs. POST
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3096 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-07 03:10:28 +00:00
Adrian Holovaty b3a6348bc2 Added Manager.get_or_create()
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3092 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-07 00:09:29 +00:00
Adrian Holovaty 168429d597 Fixed #593 -- Added 'search' DB-API lookup type, which does full-text index searches in MySQL
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-03 23:28:24 +00:00
Adrian Holovaty 1717b94fc8 Fixed #2064 -- Added 'Falling back to raw SQL' section to docs/db-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3054 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-02 04:04:04 +00:00
Adrian Holovaty 0fc2a2c1a8 Added 'Overriding default model methods' section to model-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2955 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-22 03:01:02 +00:00
Malcolm Tredinnick 34b798cb42 Fixed #1815: More documentation proof-reading from nico@teknico.net.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2908 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-15 11:33:17 +00:00
Adrian Holovaty 4b69ef637a Fixed #1815 -- Fixed ReST errors in docs. Thanks, nico@teknico.net
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2869 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-09 15:21:28 +00:00
Luke Plant 3c72a46f62 Updated docs regarding QuerySet slicing and IndexError, in line with r2859
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2862 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-06 22:55:30 +00:00
Adrian Holovaty 862328a98f Simplified example in 'Limiting QuerySets' section of docs/db-api.txt.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2855 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-06 03:44:14 +00:00
Adrian Holovaty 4bc4aa2fa6 Fixed #1779 -- Fixed typo in docs/db-api.txt. Thanks, bde3@cornell.edu
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-06 03:32:01 +00:00
Adrian Holovaty 00ea535d94 Fixed #1733 -- Clarified docs/db-api.txt section on slicing QuerySets. Thanks, Luke Plant
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2837 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-05 02:56:15 +00:00
Adrian Holovaty 9a0873f77a Fixed #1742 -- Fixed ReST errors in docs/db-api.txt. Thanks, pb
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2836 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-05 02:45:13 +00:00
Adrian Holovaty fc7b5fa0ae Fixed typos in docs/db-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2824 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-03 20:01:11 +00:00
Adrian Holovaty 227d48af1c Proofread docs/db-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2820 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-03 06:22:08 +00:00
Adrian Holovaty 95cad00392 Fixed some ReST errors in docs/db-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2811 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-02 01:56:43 +00:00
Adrian Holovaty aa84e3a0df Fixed some ReST errors in docs/db-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2810 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-02 01:55:25 +00:00
Adrian Holovaty f69cf70ed8 MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-02 01:31:56 +00:00
Adrian Holovaty a0485f5c4f Fixed #1540 -- Fixed typos in docs/db-api.txt. Thanks, pb
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2670 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-04-11 03:33:19 +00:00
Adrian Holovaty 906e5dac0d Fixed #1335 -- Fixed typo in docs/db-api.txt. Thanks, Eric Walstad
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2302 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-02-10 21:43:45 +00:00
Adrian Holovaty 7a132e2754 Fixed #1285 -- Fixed bug in docs/db-api.txt. Thanks, adrianob@gmail.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-02-02 05:13:39 +00:00
Adrian Holovaty 5355ec9992 Added section to docs/db-api.txt about ordering by fields in other tables
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2076 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-01-20 20:23:57 +00:00
Adrian Holovaty 017aa34ddb Added 'Comparing objects' section to docs/db-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1986 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-01-15 22:58:35 +00:00
Adrian Holovaty 786e5477b7 Removed 'Only in Django development version' messages from the docs, because frozen docs for version 0.90 are now available
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-01-11 00:11:29 +00:00
Adrian Holovaty 6af37477bd Fixed #1116 -- Fixed two typos in docs. Thanks, Cheng
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1871 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-01-09 00:51:48 +00:00
Adrian Holovaty bf5125734e Added note to docs/db-api.txt about using distinct=True with get_values()
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1786 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-12-28 19:18:48 +00:00
Adrian Holovaty d9269055c9 Fixed typo in OR syntax example in docs/db-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-12-22 15:10:01 +00:00
Georg Bauer c464e57da9 reverted changes from [1534] and [1536] regarding ticket #966
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1541 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-12-04 18:54:44 +00:00
Georg Bauer 4ed3d57184 added documentation for the query kwargs introduced by [1534]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1536 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-12-04 14:04:56 +00:00
Adrian Holovaty 9541d7a7c7 Fixed #251 -- Added OR support to queries, via the new 'complex' DB API keyword argument. Updated docs and added unit tests. Also removed old, undocumented '_or' parameter. Thanks, Hugo.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1508 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-30 06:14:05 +00:00
Adrian Holovaty 2bb84b9c2c Fixed #875 -- Fixed typo in docs/db-api.txt. Thanks, wojtek
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1352 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-22 14:23:07 +00:00
Adrian Holovaty e3e37ed120 Fixed #724 -- Ensured get_next_by_FOO() and get_previous_by_FOO() methods don't skip or duplicate any records in the case of duplicate values. Thanks for reporting the bug, mattycakes@gmail.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1155 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-10 05:36:41 +00:00
Adrian Holovaty b5df9c308f Improved docs/db-api.txt to specify that case-sensitive ordering isn't supported
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1051 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-02 20:31:12 +00:00
Adrian Holovaty 7136eb8f3a Fixed #507 -- Changed MySQL backend so that it uses 'LIKE BINARY' for case-sensitive comparisons -- contains, startswith and endswith. Thanks, Simon
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1036 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-01 01:08:13 +00:00
Adrian Holovaty eb4f16e666 Improved docs/db-api.txt to say add_FOO() methods always return the newly-created object.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@825 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-10 20:18:56 +00:00
Adrian Holovaty 16f9b08611 Clarified get_FOO_list part of docs/db-api.txt to specify keyword arguments are also accepted
git-svn-id: http://code.djangoproject.com/svn/django/trunk@781 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-05 22:47:36 +00:00
Adrian Holovaty acde573821 Fixed typo in docs/db-api.txt. Thanks, Aggelos Orfanakos
git-svn-id: http://code.djangoproject.com/svn/django/trunk@746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-09-30 16:39:05 +00:00
Adrian Holovaty 6b4095ad10 Fixed small typo in docs/db-api.txt. Thanks, Rachel
git-svn-id: http://code.djangoproject.com/svn/django/trunk@691 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-09-25 21:57:32 +00:00
Adrian Holovaty f053130f67 Fixed ReST bugs in [689]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@690 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-09-25 21:54:51 +00:00
Adrian Holovaty 9e03747ebb Fixed ReST bugs in [688]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@689 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-09-25 21:53:06 +00:00
Adrian Holovaty c2e42e1c5c Beefed up docs/db-api.txt, adding a section for each automatic module-level API function -- and optional ones, too
git-svn-id: http://code.djangoproject.com/svn/django/trunk@688 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-09-25 21:47:31 +00:00
Adrian Holovaty 25264c8604 Fixed #122 -- BIG, BACKWARDS-INCOMPATIBLE CHANGE. Changed model syntax to use fieldname=FieldClass() syntax. See ModelSyntaxChangeInstructions for important information on how to change your models
git-svn-id: http://code.djangoproject.com/svn/django/trunk@549 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-08-25 22:51:30 +00:00
Adrian Holovaty 4f00611f74 Fixed #211 -- edit_inline_type is deprecated, in favor of edit_inline itself. For example, instead of 'edit_inline=True, edit_inline_type=meta.TABULAR', use 'edit_inline=meta.TABULAR'.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@440 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-08-09 21:08:00 +00:00
Adrian Holovaty 432e19034a Small formatting improvement to docs/db-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@408 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-08-05 14:38:22 +00:00
Adrian Holovaty 05d074670a Added 'How this is possible' section to docs/db-api.txt, describing keyword arguments in the API
git-svn-id: http://code.djangoproject.com/svn/django/trunk@407 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-08-05 14:33:29 +00:00
Adrian Holovaty b307fb09bb Fixed #239 and #107 -- Changed model init() to use Field.get_default() if the value wasn't explicitly passed as a keyword argument. That means setting 'id=None' is no longer necessary, and you can leave off fields if you want them to have default values set.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@360 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-08-01 16:26:39 +00:00
Adrian Holovaty 284948b9cf Fixed #166 -- Added an 'in' lookup type to the database API
git-svn-id: http://code.djangoproject.com/svn/django/trunk@318 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-26 16:53:58 +00:00
Adrian Holovaty 63009faa14 Added 'ne' lookup type to docs/db-api
git-svn-id: http://code.djangoproject.com/svn/django/trunk@317 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-26 16:26:48 +00:00
Adrian Holovaty 786c750c40 Fixed #163 -- Added 'pk' database API option, which is a shorthand for (primary_key)__exact
git-svn-id: http://code.djangoproject.com/svn/django/trunk@316 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-26 16:11:43 +00:00
Adrian Holovaty c2a5c49ac2 Fixed #153 -- Changed docs to use new ordering syntax
git-svn-id: http://code.djangoproject.com/svn/django/trunk@299 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-22 18:45:22 +00:00
Adrian Holovaty df66763406 Fixed #67 -- Human-readable name is now optional in model fields. If a second positional argument isn't given, Django will use the first argument, converting underscores to spaces. This change is fully backwards-compatible.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@212 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-19 17:20:37 +00:00
Adrian Holovaty e243d82874 Fixed ReST formatting bug in db-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-19 15:44:04 +00:00
Adrian Holovaty 5797066383 Added support for istartswith and iendswith in database API
git-svn-id: http://code.djangoproject.com/svn/django/trunk@207 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-19 15:24:03 +00:00
Jacob Kaplan-Moss 604cd7fe14 Yes yes yes -- more documentation improvements
git-svn-id: http://code.djangoproject.com/svn/django/trunk@67 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-15 20:37:03 +00:00
Adrian Holovaty dc2933f73b Fixed #3 -- Made OneToOneField act like ForeignKey and ManyToManyField. This is the last big API change before the official launch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@59 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-15 18:40:21 +00:00
Jacob Kaplan-Moss f19dbab514 Made a bunch of doc improvements
git-svn-id: http://code.djangoproject.com/svn/django/trunk@41 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-15 00:42:28 +00:00
Jacob Kaplan-Moss 5fc13947fc Fixed a couple of bugs in the docs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@39 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-14 21:04:21 +00:00
Adrian Holovaty 26c6566215 Made some changes to db-api docs
git-svn-id: http://code.djangoproject.com/svn/django/trunk@32 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-14 19:25:13 +00:00
Jacob Kaplan-Moss 1cb1d9cd07 Moved django-docs to just plain docs
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-13 18:54:07 +00:00