1. Luke Plant
  2. django

Branches

attic/queryset-refactor

View source
attic/queryset-refactor
  • Contributors
    1. Loading...
Author Commit Message Date Builds
250+ commits behind default.
uber...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Move the queryset-refactor branch into the attic.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed some missing imports from [7470]. Thanks, Justin Bronn.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a Model.from_sequence() constructor for internal and advanced usage.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Pass any extra(select=...) columns through the value conversion function in the Oracle backend after reading the row from the database. Refs #7087 (see comment 7 on that ticket).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Make sure the right list of fields is passed to the Query.resolve_columns() method for those backends that provide it (e.g. Oracle). Refs #7088
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Repaired the dates() method with extra(select=...).xi It was broken by [7340]. Patch from Ian Kelly. Fixed #7087.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: For custom Q-like objects, pass in the used_aliases parameter (see [7462]) from Query.add_q() to their add_to_query() method. This provides custom objects with the same context as Q's.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a few modifications to the select column aliases from [7457], based on a patch from Ian Kelly. Fixed #7057.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Typo fix, spotted by Justin Bronn. Fixed #7089.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed some bugs in the multi-valued filtering behaviour introduced in [7317]. It was failing in a couple of different ways on some complex Q() combinations. Fixed #7047
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Simplify the way filters are passed to the Query class. This removes a lot of the complexity for handling exclude() calls and results in more efficient code. I feel a bit stupid for not having spotted this earlier.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a typo that was shown up by some simplification refactoring.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a bug in the internal Query.join_map datastructure. Could result in some incorrect results(?) when using the same table multiple times in a query.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: An attempt to fix an ambiguous column error that can arise in Oracle queries. Adds an options to add output column aliases. The testing I can do shows that the query is being constructed correctly. I haven't run the test against an Oracle install, though. Refs #7057 (ticket can be closed if the Oracle tests pass).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Changed the way order_by() and distinct() interact. 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() const…
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: A few bits of code cleanup.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a note about using already present tables in 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).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Clarified what the default reverse names are for ManyToManyFields and ForeignKeys on abstract base classes.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Renamed the Queryset method valueslist() to values_list. 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).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed a warning about "experimental API", since there's not really any obviously better way to do this. Let it stand.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a crash when using extra(tables=...). Fixed #7045.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed the interaction between extra(select=...) and valuelist(). Fixed #7053.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed an unwanted side-effect from the Query.as_sql() method. Fixed #7056
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed some errors in Oracle regex handling that were introduced in [7087]. Patch from Ian Kelly. Fixed #7065.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: The change in [7438] didn't fix #7036 properly. This is a more comprehensive diagnosis and fix from Ian Kelly. Fixed #7036.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Made on of the tests use more portable SQL to help Oracle. Patch from Ian Kelly. Fixed #7058.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Don't use the "AS" keyword in the FROM-clause. Fixed #7055. Patch from Ian Kelly. This keyword is optional in SQL, but not permitted by Oracle. If we ever need to support a backend that requires this keyword at some later date, we can make it a connection.feature option, but that's overkill for now.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed db column to model field mapping for Oracle backend. Thanks, Justin Bronn. Fixed #7036.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added faster paths for updates and inserts that are done from other core code. This saves a round-trip from field object to field name and back to field object when we already have the right information to hand.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed a stray, unused import that crept into [7432].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a way to specify the related_name attribute on abstract base classes.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a few inadvertent sharing problems for related fields in abstract base classes. This means, for example, that many-to-many fields can be used in abstract base classes.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7424].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Detect infinite ordering loops when relations refer to 'self'.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added some missed quoting to a table name. (Noticed in passing in the patch on #6596). Refs #6596.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: The Oracle changes necessary for [7426]. I can't test these at the moment, but they should be close to correct. Refs #6956.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Querysets no longer need to be customised per-backend. Instead, it's the Query class that is backend-dependent. So make that explicit in the code (code should refer to sql.Query and they will always get the right backend-specific class). This also fixes the main part of #6956, in that the various subclasses of Query automatically use any custom Query class. Fixed #6956.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Fixed #6957 -- Removed a stray reference to QuerySet._select_related and added a way to copy the select_related() settings from an existing queryset.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Rewrote [7417] so that it involves less overall indentation.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: When using select_related() with an explicit foreign key, use the right join type if the FK is nullable. Fixed #6981.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Fixed #6899 -- Fixed a problem with boolean evaluation of empty querysets. Based on patches from cide@ctmod.net and brodie.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7415].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7388].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Moved _merge_sanity_check into a more logical place in the code.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: People are getting picky about my spelling.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Correctly inherit m2m fields from abstract base classes. Based on a patch from cide@ctmod.net. Fixed #6844.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed an unneeded comparison to NULL for non-nullable ForeignKey field lookups.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added support for cross-relation values() queries when extra(select=...) was present (previously, it only worked without extra()). Also, better error reporting for values() queries with bad field names.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added some sanity checking to __and__() and __or__() because some people insist on trying to merge a Queryset and a ValuesQuerySet.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7338].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed up extra(select=...) calls with parameters so that the 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.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queyrset-refactor: Allow default managers to be inherited from an abstract base class, unless the child class defines its own manager (i.e. child has first chance to define the default). All managers were already inherited. This just changes how the default is set in the case when the child defines no manager and an abstract parent does.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a missing space in the SQL construction.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Initial pass at fixing the Oracle support. Thanks, Justin Bronn. Fixed #6161 This is untested (by me) and is a slight modification on Justin's original patch, so feedback and bug reports are welcome.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added support for munging of insert columns. Needed to support cases like GIS fields. Patch from Justin Bronn.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Implemented a way to differentiate between filtering on a single instance and filtering on multiple instances when spanning a multi-valued relationship.
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Changed django.VERSION to include 'queryset-refactor'
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Allow exclusions when bumping the aliases on a subquery.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed problems with values() queries across nullable relations.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactored: Added a test to show that ordering on multi-valued fields might not be what is expected.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Undo [7220] and allow ordering on multi-valued field. 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.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed the facility for select_related(False). It was useless.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Different database backends return different empty sequences when fetchmany() is exhausted. This change allows for that. Fixed #6807. Nice debugging from tpherndon.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Typo fix. Fixed #6806.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7280]
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queyrset-refactor: Some more speed-ups due to datastructure changes.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: More whack-a-mole optimisation work. Still got a couple of big spots to go, though.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Typo fix.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a typo spotted by msaelices. Fixed #6787.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Optimised the SQL portion of Model.save().
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Sped up QuerySet.get() by using fast paths through the iterator maze.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Optimised some internal data structures in sql/query.py. Mostly this involves changing them to a "copy on write" implementation, which speeds up cloning (and the relevant structures aren't updated very frequently).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Optimised len(qs) and iter(qs) a bit.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: The EmptyResultSet exception was declared in two places. Removed one of them.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed the "in" lookup type when using tuples. Accidentally broken in r7170. Fixed #6772.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Some goose left commented out code in [7240]. Nothing to see here. Move along.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Second part of select_related() fix. Relations on the parent model can now be specified as part of the fields list. Fixed #6761.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed default (no fields) case of select_related() to work with model inheritance. Refs #6761.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Changed the return type of an internal function. Previous polymorphic return type was dumb.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Made sure that update filter queries only return a single column. Fixed #6760.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Made none() a method on Querysets, as the documentation indicates (it was only added to managers in [4394]. Refs #6177.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a way to change the prefix of all aliases in a query. This fixes the last few corner cases for nested queries that had overlapping aliases. Also tidies up a couple of internal data structures.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Refactored the way values() works so that it works properly 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.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Infinite loop detection in model ordering was being a little too aggressive. Fixed that.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Reorganised Model.save() to differentiate between public 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 in…
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queyrset-refactor: Added error reporting if somebody tries to order by a multi-valued field.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7216].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed an oversight in Model.save() that was preventing updates to parent models beyond the initial save. Fixed #6706.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Reworked exclude() handling to fix a few merging problems. Fixed #6704.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Simplified updates of related tables, with added bonus of less bugs. It will be slightly less efficient in rare cases, but who cares? If anybody needs it to be as efficient as possible they can write the query manually and this is good enough for the other 98% or so.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a small error in [7179].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Made update() work with inherited models.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a problem in the test-suite that was annoying. Only fails on PostgreSQL and only fails on the next test. Also identified the other area that causes both PostgreSQL backends (only) to fail. Don't really understand why at the moment, but this is the culprit. Tricky to reproduce, too, you have to run "queries" and "views" together, in that order to see it.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7168].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Head off any attempts to use unique_together across inherited models. We don't support check constraints and triggers, so trying to do this would be optimistic at best.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added caching for reverse-one-to-one lookups. This is the only type of reverse lookup where caching makes sense might make some kinds of model inheritance interactions more database friendly.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed exclude() filtering for the various N-to-many relations. This means we can now do nested SQL queries (since we need nested queries to get the right answer). It requires poking directly at the Query class. Might add support for this through QuerySets later.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a few really silly errors in the Q class and negation handling in the tree class. Discovered whilst starting to fix exclude().
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Typo fix. Fixed #6670. Thanks, alex.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed some more dead code.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Moved the Query subclasses into their own file. Trying to keep file lengths to something manageable.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed #6664. Calling list() no longer swallows field errors. This is slightly backwards incompatible with previous behaviour if you were doing Tricky Stuff(tm) -- the exception type has changed if you try to create a bad queryset.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed some unused code left over from an earlier attempt.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a test to show that #6180 is fixed. Refs #6180.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7151].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added valuelist() method to querysets. Refs #2482.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Implemented the reverse() method on querysets. Refs #5012.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Implemented slicing to end of querysets. Refs #2150, #5012.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed the case of calling update() on a model manager.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed some tuple unpacking in a function signature. This isn't going to be permitted in Python 3, so might as well not use it here.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Whilst writing a test to bullet-proof [7141], a bug showed up.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added the ability to manually specify a child-parent link.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed up and documented Meta-class inheritance. Should be mostly logical (for versions of "logical" that may require you to be a Vulcan, admittedly, but that's not entirely my fault).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a couple of FIXME items. These are mostly code cleanups, although now we also install the right type of class for our exception sublasses on models in Python 2.5.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from turnk up to [7135] because I need some stuff.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Model inheritance support. This adds both types of model inheritance: abstract base classes (ABCs) and multi-table inheritance. See the documentation and tests / examples for details. Still a few known bugs here, so don't file tickets (I know about them). Not quite ready for prime-time usage, but it mostly works as expected.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7122].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Two files were missed during the latest merge from trunk.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7098] (because I need the last commit on this branch).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed up OneToOneFields (mostly). They now share as much code as possible with ForeignKeys, but behave more or less as they did before (the backwards incompatible change is that they are no longer automatically primary keys -- so more than one per model is permitted). The documentation still uses an example that is better suited to model inheritance, but that will change in due course. Also, the admin interface still shows them a…
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a place where admin was poking about under the covers and I had moved the internal feature it was relying on.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added (back) in support for using strings in slices. Apparently there exists code that like to do this, including the admin interface.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed handle_legacy_orderlist() call from admin. Refs #245.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed another FIXME. This time, simplifying the delete() method.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a typo that's been hiding out for a few months.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Moved some backend-specific features into the database backend code.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged changes from trunk up to [7085].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: s/udpate/update. :-(
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Ported almost all of the raw SQL statements in the Model class over to use queryset operations. This is the first part of a long process of removing raw SQL from all over the place. The tests pass, but it's quite possible other stuff won't work yet. In the process, added tests for order_with_respect_to so that I didn't screw it up.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added some error checking for a potential crasher if model ordering is set up in a cycle somehow. The error reporting here isn't perfect (it doesn't give any hints about what the infinite loop might be), but it's better than nothing.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed an idiotic, last-minute typo in [7043].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added an update method to QuerySets, since it's needed for 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.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a way to clear all default ordering from a queryset, by calling order_by() with no parameters.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added the ability to use a subclass of WhereNode in queries. Also allow extension of the permitted lookup terms. Both of these are drive by geo-django requirements, but should be generally useful. Thanks, Justin Bronn. Fixed #6261.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Converted the queryset iterator to be a real iterator and only populate the result cache on demand. We actually populate the result cache 100 elements at a time, rather than one at a time for efficiency, but this is a real win when the resultset contains 10,000 objects for example. This also provides an efficient boolean (__nonzero__) test that doesn't use up a lot of memory if you don't read all the results. Refs #2430, #5987.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7025].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [7002].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a couple of tests to demonstrate table handling in order_by() situations. One is known to fail (and commented out for now).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Work around the fact that "where id is NULL" can return different results in different circumstances in MySQL(!!).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Tweaked one test slightly to work around a PostgreSQL oddity.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Reverted [6762] because it generates invalid SQL. It only worked accidentally with SQLite. Refs #4002.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Tweaked quote_name_if_not_alias() slightly.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Made qs.dates(...).count() work. This involved a slight change in the SQL for .dates() which appears to be correct and passes all the tests, but may have some side-effect I don't know about. Refs #6203.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed the way join promotions are done when joining queries (particularly the disjunctive -- 'OR' -- case). This fixes a FIXME and produces better queries.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a problem when adding certain additional filters to a queryset that has precisely one filter attached already. Refs #6154.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [6953].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a test to show that various Q() combinations work when the same field with different lookup types are combined. Refs #4289.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Allow specifying of specific relations to follow in select_related(). Refs #5020.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a couple of differences between trunk and this branch that were caused by merge errors.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a FIXME for something I just remembered.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed disjunctions of empty result sets. Refs #6074.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed query disjunctions.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Changed all tree and filter "connections" to "connectors" so that database connections and constraint connectors look different in the code. George Vilches pointed out this was slightly confusing previously.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Changed execute_sql() to not return an iterator in the non-MULTI cases when there is an empty result set.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a test for #6074 so that it gets fixed.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Changed maxlength to max_length in a couple of tets. Silences some deprecation warnings.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [6856].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Implemented filtering by output columns specified in extra(select=...). Refs #4002.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Interpret qs.filter(foo=None) to be the same as qs.filter(foo__isnull=True). Refs #2737.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed some Python 2.3 problems.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed an off-by-one error when filling the select-related case. Only affects people using select_related() with the "depth" parameter *and* extra(select=...) simultaneously. Refs #6018. Thanks, Matthias Urlichs.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [6752].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Optimisation pass. The test suite is now within 2% of trunk and it's a fairly pathological case. Introduces a couple of test failures due to some simplification in the code. They'll be fixed later.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [6724].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed up a few problems from the previous merge from trunk.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [6689].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [6635].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [6623].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added the ability to apply parameters to the select fragments in QuerySet.extra(). Refs #2902
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a convenience all() method to Querysets. Refs #3739
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed an order_by() regression. It must override any existing ordering, not append to it.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged from trunk up to [6595].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Changed post_delete signal behaviour back to match trunk's version (it wasn't in error after all).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a broken select_related test from [6521].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a possibility of shooting oneself in the foot and creating infinite recursion with select_related(). Refs #3045, #3288.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a bunch of "new in development version" markers for recent additions.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a test to show that #5261 is no longer a problem. Refs #5261.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added ~ support to Q-objects. Based heavily on a patch from Collin Grady. Refs #4858.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed values(...).select_related(...) bug that was introduced in [6512]. The lookup tests picked this up.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Made the use of values() for ForeignKey fields consistent and documented this feature. Refs #4358.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Made sure the ordering columns in a distinct() query only include the columns we are selecting on. This avoids some PostgreSQL problems and leads to more efficient queries to boot. Refs #5321.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a test to show that #3037 is really fixed. Refs #3037.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Updated documentation to describe the new order_by() and extra(order_by=...) behaviour.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a couple of typos that were messing up extra(select=...).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added an order_by parameter to extra(). Refs #2076.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a large bag of order_by() problems. This also picked up a small bug in some twisted select_related() handling. Introduces a new syntax for cross-model ordering: foo__bar__baz, using field names, instead of a strange combination of table names and field names. This might turn out to be backwards compatible (although the old syntax leads to bugs and is not to be recommended). Still to come: fixes for extra() handling, since the new …
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed handling of extra(tables=...). In passing, this solves a duplicate table / bad SQL problem. Refs #2496.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Added a test to show we can now query for empty reverse relationships. Refs #2400.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed Options.get_order_sql(). It has no role to play any longer.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed a whole bunch of unused code. This includes the final remnants of handle_legacy_orderlist(). Refs #245.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed unneeded import.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a problem with count() queries -- we were creating an "ORDER BY" clause sometimes and that isn't accepted by PostgreSQL (and a waste of time on other databases as well).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed some quoting problems with aliases. These showed up for PostgreSQL, but this approach is a bit more robust in general, I suspect.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Made all the changes needed to have count() work properly with ValuesQuerySet. This is the general case of #2939. At this point, all the existing tests now pass on the branch (except for Oracle). It's a bit slower than before, though, and there are still a bunch of known bugs that aren't in the tests (or only exercised for some backends).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Previous exclude() fixing broke the simple case. Fixed that (the lookup tests picked this up).
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed the optimization that potentially removes the final join to handle the case where a to_field attribute is given for the join.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed the SQL construction when excluding items across nullable joins. This is #5324 plus a few more complex variations on that theme.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a bug in Node.negate() for already negated nodes.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Create a new join when merging two QuerySets that use a 1-m field.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Removed a test that can be better (and simply) fixed on trunk
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a problem in the isnull=True handling.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
querset-refactor: Fixed a bunch of little things as a result of working on the tests. All of modeltests/ now pass. This includes a fix to modeltests/signals/ (in the post_delete signal testing), which I'm sure was incorrect previously.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Re-added a docs change that was accidentally lost in the merge in [6466].
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: integrate select_related() into SQL generation.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Ported DateQuerySet and ValueQuerySet over and fixed most of the related tests.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed small deepcopy bug in Where clauses.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Fixed a bug in QuerySet.get(). Also removed unneeded code form EmptyQuerySet.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged changed from trunk up to [6463].
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged to [6381]
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged to [6340]
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged to [6300]
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged to [6250]
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged to [6220]
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged to [6198]
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged to [6197]
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged to [6190]
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged to [6155]
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged to [6140]
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
queryset-refactor: Merged to [6130]
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Fixed some more join and lookup tests.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Fixed deleting via generic relations.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Use the correct column in custom column handling.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Fixed limit/offset computations.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Added missing file.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Initial portion of queryset rewrite. This breaks a lot more than it fixes in the current state. Committing so that Adrian and I can work on it together. Do not try to use this yet!
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Created a tree data structure. Might be generically useful. Currently used for constructing queries.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Added a note about not using 'pk' as a field name for a non-primary-key field.
mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Created some tests to show ORM queries that are problematic. Still incomplete at the moment, but this version doesn't crash the test framework.
adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37
Created queryset-refactor branch, for Malcolm's refactoring of django.db.models.query and related code