summaryrefslogtreecommitdiff
path: root/docs/db-api.txt
AgeCommit message (Collapse)Author
2008-04-24queryset-refactor: Changed the way order_by() and distinct() interact.Malcolm Tredinnick
When using "select distinct" all ordering columns must be part of the output (select) columns. We were previously just throwing away ordering columns that weren't included, but there are some cases where they are needed and it's difficult to add them in manually. So now the default behaviour is to append any missing columns. This can affect the output of distinct() if complicated order_by() constructs are used, so the documentation has been updated with an explanation of what's going on there. Fixed #7070. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7455 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-24queryset-refactor: Added a note about using already present tables inMalcolm Tredinnick
extra(tables=...). This is already a problem in trunk and it's pretty much impossible to work around in a non-complex way, so it's user beware (it's usually easy enough to avoid the problems). git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7453 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-24queryset-refactor: Renamed the Queryset method valueslist() to values_list.Malcolm Tredinnick
Suggested by Michael Trier. It's more consistent with order_by, select_related, etc. This is backwards incompatible for people previously using this method on the branch (the method doesn't exist on trunk, so it's very minor). git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7451 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-23queryset-refactor: Removed a warning about "experimental API", since there'sMalcolm Tredinnick
not really any obviously better way to do this. Let it stand. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7448 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-01queryset-refactor: Merged from trunk up to [7388].Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7396 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-20queryset-refactor: Fixed up extra(select=...) calls with parameters so that theMalcolm Tredinnick
parameters are substituted in correctly in all cases. This introduces an extra argument to extra() for this purpose; no alternative there. Also fixed values() to work if you don't specify *all* the extra select aliases in the values() call. Refs #3141. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7340 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-19queryset-refactor: Implemented a way to differentiate between filtering on aMalcolm Tredinnick
single instance and filtering on multiple instances when spanning a multi-valued relationship. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7317 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-18queryset-refactor: Undo [7220] and allow ordering on multi-valued field.Malcolm Tredinnick
Some people will shoot themselves in the foot with this. That's bad luck. The reason we need it is because some data semantics cannot be expressed in Django's ORM and that shouldn't prevent ordering on that data. For example, filtering suburbs by a geographic region and then ordering on the suburb names. The names might not be unique outside that region, but unique inside it. Django cannot know that (you can't tell the model about it), so we trust the caller. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7285 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-12queryset-refactor: Refactored the way values() works so that it works properlyMalcolm Tredinnick
across inherited models. Completely by accident, this also allows values() queries to include fields from related models, providing it is crossing a single-valued relation (one-to-one, many-to-one). Many-to-many values() fields still aren't supported, since that requires actual thinking. So this refs #5768. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7230 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-11queryset-refactor: Reorganised Model.save() to differentiate between public ↵Malcolm Tredinnick
and private parameters. Refs #6741. This means subclasses can override save() without needing to worry about passing around the internal parameters (an issue for subclassable models, which would have meant every model, since you don't know when somebody will subclass your model). Slightly backwards incompatible, since it moves "raw" back to being part of the internal API (it's only needed by the serializer and was intended to be internal use only). If external code really needs this, they can call Model.save_base() and pass in raw there. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7221 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-11queyrset-refactor: Added error reporting if somebody tries to order by a ↵Malcolm Tredinnick
multi-valued field. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7220 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-23queryset-refactor: Added valuelist() method to querysets. Refs #2482.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7149 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-23queryset-refactor: Implemented the reverse() method on querysets.Malcolm Tredinnick
Refs #5012. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7148 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-23queryset-refactor: Implemented slicing to end of querysets.Malcolm Tredinnick
Refs #2150, #5012. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7147 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-20queryset-refactor: Merged from turnk up to [7135] because I need some stuff.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7136 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-28queryset-refactor: Added an update method to QuerySets, since it's needed forMalcolm Tredinnick
moving SQL out of the core code. Only direct fields and foreign keys can be updated in this fashion, since multi-table updates are very non-portable. This also cleans up the API for the UpdateQuery class a bit. Still need to change DeleteQuery to work similarly, I suspect. Refs #4260. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7043 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-28queryset-refactor: Added a way to clear all default ordering from a queryset,Malcolm Tredinnick
by calling order_by() with no parameters. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7042 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-09queryset-refactor: Allow specifying of specific relations to follow inMalcolm Tredinnick
select_related(). Refs #5020. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6899 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-30queryset-refactor: Interpret qs.filter(foo=None) to be the same as ↵Malcolm Tredinnick
qs.filter(foo__isnull=True). Refs #2737. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6760 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-24queryset-refactor: Added the ability to apply parameters to the selectMalcolm Tredinnick
fragments in QuerySet.extra(). Refs #2902 git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6603 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-23queryset-refactor: Added a convenience all() method to Querysets. Refs #3739Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6600 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15queryset-refactor: Added a bunch of "new in development version" markers forMalcolm Tredinnick
recent additions. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6520 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15queryset-refactor: Added ~ support to Q-objects. Based heavily on a patch fromMalcolm Tredinnick
Collin Grady. Refs #4858. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6518 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15queryset-refactor: Made the use of values() for ForeignKey fields consistentMalcolm Tredinnick
and documented this feature. Refs #4358. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6516 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15queryset-refactor: Updated documentation to describe the new order_by() andMalcolm Tredinnick
extra(order_by=...) behaviour. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6513 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14queryset-refactor: Re-added a docs change that was accidentally lost in the ↵Malcolm Tredinnick
merge in [6466]. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6488 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-08queryset-refactor: Merged changed from trunk up to [6463].Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6466 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15queryset-refactor: Merged to [6340]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6341 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15queryset-refactor: Merged to [6300]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6340 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15queryset-refactor: Merged to [6190]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15queryset-refactor: Merged to [6130]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6330 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13Added a note about not using 'pk' as a field name for a non-primary-key field.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6114 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-31Made negligible capitalization fix to docs/db-api.txtAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6027 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-25Removed incorrect link that slipped in docs/db-api.txt in [6010]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6011 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-25Fixed #5068 -- Fixed error in docs/db-api.txt. Thanks, Collin Grady and ↵Adrian Holovaty
SmileyChris git-svn-id: http://code.djangoproject.com/svn/django/trunk@6010 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-05Fixed #2101 -- Renamed `maxlength` argument to `max_length` for oldforms ↵Gary Wilson Jr
`FormField`s and db model `Field`s. This is fully backwards compatible at the moment since the legacy `maxlength` argument is still supported. Using `maxlength` will, however, issue a `PendingDeprecationWarning` when used. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-05Changed some more links to be relative in the documentation. I had a couple ↵Gary Wilson Jr
unsaved files that didn't get in with [5798]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5802 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-04Changed several documentation links to be relative.Gary Wilson Jr
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5798 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-01Fixed #5037 -- Fixed use of wrong field type in a db-api docs example, ↵Gary Wilson Jr
thanks ubernostrum. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5783 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-25Added 'New in Django development version' to docs/db-api.txt change from [5746]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5757 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-22Fixed #4373 -- Modified the get_object_or_404/get_list_or_404 shortcuts to ↵Gary Wilson Jr
also accept `QuerySet`s. Thanks SuperJared. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-16Fixed #4851 -- Fixed description of an example query in `db-api` docs.Gary Wilson Jr
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5720 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-15Edited docs/db-api.txt changes from [5700]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5709 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-15Clarified the documentation on the steps that happen during a save, and how ↵Russell Keith-Magee
raw save affects those steps. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5700 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-14Edited docs/db-api.txt changes from [5658]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5698 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-12Fixed #4459 -- Added 'raw' argument to save method, to override any pre-save ↵Russell Keith-Magee
processing, and modified serializers to use a raw-save. This enables serialization of DateFields with auto_now/auto_now_add. Also modified serializers to invoke save() directly on the model baseclass, to avoid any (potentially order-dependent, data modifying) behavior in a custom save() method. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5658 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04Merged Unicode branch into trunk (r4952:5608). This should be fullyMalcolm Tredinnick
backwards compatible for all practical purposes. Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-01Fixed #4690 -- Fixed a bunch of ReST errors in docs. Thanks, Paul B.Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5571 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-30Edited docs/db-api.txt changes from [5555]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5566 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-27Fixed #4712: added mention of Oracle in docs from [5555]. Thanks, Tom.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5556 bcc190cf-cafb-0310-a4f2-bffc1f526a37