django1/django/utils
Anssi Kääriäinen d3f00bd570 Refactored qs.add_q() and utils/tree.py
The sql/query.py add_q method did a lot of where/having tree hacking to
get complex queries to work correctly. The logic was refactored so that
it should be simpler to understand. The new logic should also produce
leaner WHERE conditions.

The changes cascade somewhat, as some other parts of Django (like
add_filter() and WhereNode) expect boolean trees in certain format or
they fail to work. So to fix the add_q() one must fix utils/tree.py,
some things in add_filter(), WhereNode and so on.

This commit also fixed add_filter to see negate clauses up the path.
A query like .exclude(Q(reversefk__in=a_list)) didn't work similarly to
.filter(~Q(reversefk__in=a_list)). The reason for this is that only
the immediate parent negate clauses were seen by add_filter, and thus a
tree like AND: (NOT AND: (AND: condition)) will not be handled
correctly, as there is one intermediary AND node in the tree. The
example tree is generated by .exclude(~Q(reversefk__in=a_list)).

Still, aggregation lost connectors in OR cases, and F() objects and
aggregates in same filter clause caused GROUP BY problems on some
databases.

Fixed #17600, fixed #13198, fixed #17025, fixed #17000, fixed #11293.
2013-03-13 10:44:49 +02:00
..
2to3_fixes [py3] Added fixer for python_2_unicode_compatible. 2012-08-12 14:44:40 +02:00
translation Fixes #19763 - LocaleMiddleware should check for supported languages in settings.LANGUAGE_CODE 2013-02-24 14:43:45 +01:00
unittest Fixed #19204 -- Replaced python2-style exception syntax. 2012-12-24 14:05:36 +01:00
__init__.py Imported Django from private SVN repository (created from r. 8825) 2005-07-13 01:25:57 +00:00
_os.py Fixed #19357 -- Allow non-ASCII chars in filesystem paths 2012-12-08 11:13:52 +01:00
archive.py Ensured that the archive module consistantly explicitly closed all files. 2012-08-15 02:53:40 -07:00
autoreload.py Made dev server autoreloader ignore filenames reported as None. 2013-01-11 15:31:39 -03:00
baseconv.py Fix copyright holder 2012-07-06 15:24:07 -03:00
cache.py [py3] Always fed hashlib with bytes. 2013-02-27 10:02:07 +01:00
checksums.py Removed django.contrib.localflavor. 2012-12-29 21:59:06 +01:00
crypto.py [py3] Always fed hashlib with bytes. 2013-02-27 10:02:07 +01:00
daemonize.py Switched to octal notation (bis). 2012-07-20 13:42:44 +02:00
datastructures.py Advanced pending deprecation warnings. 2012-12-29 21:59:07 +01:00
dateformat.py Fixed #18951 -- Formatting of microseconds. 2012-09-22 12:02:21 +02:00
dateparse.py Fixed #18728 -- Made colon optional in tzinfo 2012-08-19 21:47:41 +02:00
dates.py Fixed #9988 (again) -- Updated list of Associated Press months names to use a translation context. Thanks, Claude Paroz. 2011-01-21 22:25:50 +00:00
datetime_safe.py Fixed #12524 -- Clarified handling of pre-1000AD dates in datetime_safe (and thus, the serializers). Patch includes moving the datetime_safe tests into the utils regressiontests module. Thanks to gsf for the report and initial patch. 2010-02-13 14:02:32 +00:00
decorators.py Restricted a workaround for a bug in Python to the affected versions. 2013-03-12 14:05:10 +01:00
deprecation.py Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that return a QuerySet. 2013-03-08 10:11:45 -05:00
dictconfig.py remove a bunch of unnescesarry iterkeys() calls 2012-08-08 07:33:15 -07:00
encoding.py Fixed getting default encoding in get_system_username 2013-03-02 22:41:08 +01:00
feedgenerator.py Fixed #9800 -- Allow "isPermaLink" attribute in <guid> element of an RSS item. 2013-02-06 05:28:05 -05:00
formats.py Fixed #19917 -- Added microseconds in default TIME_INPUT_FORMATS 2013-03-02 18:11:10 +01:00
functional.py PEP8 cleanup of functional.py 2013-03-06 16:14:46 -08:00
html.py Improved regex in strip_tags 2013-02-06 21:20:43 +01:00
html_parser.py Fix an HTML-parser test that's failed in Python 2.6.8 since 5c79dd58. 2012-09-09 12:13:42 -06:00
http.py Fixed #18856 -- Ensured that redirects can't be poisoned by malicious users. 2012-12-10 22:11:39 +01:00
importlib.py [py3] Added Python 3 compatibility for xrange. 2012-07-22 09:29:56 +02:00
ipv6.py [py3] Replace filter/lambda by list comprehensions 2012-08-14 14:31:06 +02:00
itercompat.py Advanced pending deprecation warnings. 2012-12-29 21:59:07 +01:00
jslex.py Fixed #16971 - Made the parsing of javascript files by 'makemessages' much faster. Thanks Antti Haapala for the implementation and Ned Batchelder for the patch. 2011-10-04 20:11:41 +00:00
log.py Fixed #19637 -- Ensured AdminEmailHandler fails silently 2013-01-21 20:32:36 +01:00
module_loading.py Fixed #17061 -- Factored out importing object from a dotted path 2013-02-04 16:38:25 +01:00
numberformat.py Fixed #18800 -- Support numbers bigger than max float in `numberformat`. 2012-09-18 19:43:50 +02:00
regex_helper.py [py3] Ported django.utils.regex_helper. 2012-08-07 12:00:24 +02:00
safestring.py [py3] Ported django.utils.safestring. 2012-08-18 16:04:06 +02:00
simplejson.py Advanced pending deprecation warnings. 2012-12-29 21:59:07 +01:00
six.py Add a BinaryField model field 2013-03-02 10:29:02 +01:00
synch.py Removed with_statement imports, useless in Python >= 2.6. Refs #17965. Thanks jonash for the patch. 2012-03-30 08:02:08 +00:00
termcolors.py Fixed #19663 -- Allowed None in colorize() text parameter 2013-02-01 22:53:18 +01:00
text.py Fixed #19693 -- Made truncatewords_html handle self-closing tags 2013-02-13 18:24:49 +01:00
timesince.py Fixed #19704 -- Make use of new ungettext_lazy function at appropriate places 2013-02-06 22:01:55 +01:00
timezone.py Accepted None in tzname(). 2013-02-11 21:56:35 +01:00
tree.py Refactored qs.add_q() and utils/tree.py 2013-03-13 10:44:49 +02:00
tzinfo.py Accepted None in tzname(). 2013-02-11 21:56:35 +01:00
version.py Ensured get_version returns a native string. 2012-10-25 21:49:18 +02:00
xmlutils.py Eliminated lots of mutable default arguments (since they are bugs 2006-06-03 13:37:34 +00:00