summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2012-08-26Code comment fix.Mitar
2012-08-25Fixed #16715 -- Fixed join promotion logic for nested nullable FKsAnssi Kääriäinen
The joins for nested nullable foreign keys were often created as INNER when they should have been OUTER joins. The reason was that only the first join in the chain was promoted correctly. There were also issues with select_related etc. The basic structure for this problem was: A -[nullable]-> B -[nonnull]-> C And the basic problem was that the A->B join was correctly LOUTER, the B->C join not. The major change taken in this patch is that now if we promote a join A->B, we will automatically promote joins B->X for all X in the query. Also, we now make sure there aren't ever join chains like: a LOUTER b INNER c If the a -> b needs to be LOUTER, then the INNER at the end of the chain will cancel the LOUTER join and we have a broken query. Sebastian reported this problem and did also major portions of the patch.
2012-08-24Cleaned up the implementation of in_bulkAlex Gaynor
2012-08-23[py3] Removed duplicate imports.Aymeric Augustin
Fixed #18837. Refs #18791.
2012-08-22Revert "Fixed #18063 -- Avoid unicode in Model.__repr__ in python 2"Simon Meers
This reverts commit 3fce0d2a9162cf6e749a6de0b18890dea8955e89.
2012-08-21Fixed #17886 -- Fixed join promotion in ORed nullable queriesAnssi Kääriäinen
The ORM generated a query with INNER JOIN instead of LEFT OUTER JOIN in a somewhat complicated case. The main issue was that there was a chain of nullable FK -> non-nullble FK, and the join promotion logic didn't see the need to promote the non-nullable FK even if the previous nullable FK was already promoted to LOUTER JOIN. This resulted in a query like a LOUTER b INNER c, which incorrectly prunes results.
2012-08-20[py3] Prepared MySQL backend for Python 3 compatibilityClaude Paroz
2012-08-20Fixed #18063 -- Avoid unicode in Model.__repr__ in python 2Simon Meers
Thanks guettli and mrmachine.
2012-08-19[py3] Fixed Oracle specific failuresAnssi Kääriäinen
2012-08-18[py3] Ported django.utils.safestring.Aymeric Augustin
Backwards compatibility aliases were created under Python 2.
2012-08-18Add a SQlite backend. One test passes!Andrew Godwin
2012-08-18All tests passing on MySQLAndrew Godwin
2012-08-18First stab at MySQL supportAndrew Godwin
2012-08-18[py3] Fixed backends tests.Aymeric Augustin
2012-08-18[py3] Added compatibility import of thread/_threadAymeric Augustin
This commit fixes the auto-reload of the development server. I should have done that change in ca07fda2.
2012-08-16[py3] Fixed installed_models filtering.Dmitry Shevchenko
2012-08-15[py3] Fixed F-expression right-hand divisionClaude Paroz
Complementary to commit 62a9ed0ac.
2012-08-15[py3] Pass bytes to md5 in truncate_nameClaude Paroz
2012-08-15[py3] Removed excessive usage of smart_bytesClaude Paroz
2012-08-14[py3] Removed a remaining use of __metaclass__.Aymeric Augustin
2012-08-14[py3] Fed strftime with unicode on Python 3Claude Paroz
2012-08-14[py3] Fixed F-expression division operatorsAnssi Kääriäinen
In Python 3 dividing by int will call obj.__truediv__(). This operator was missing from F-expressions.
2012-08-14[py3] Fixed admin_views testsClaude Paroz
Also changed several occurrences of 'request' to 'response'.
2012-08-14[py3] Replace filter/lambda by list comprehensionsAymeric Augustin
This is more idiomatic and avoids returning a list on Python 2 and an iterator on Python 3.
2012-08-14[py3] Removed unnecessary calls to .keys()Aymeric Augustin
when computing the length of a dictionary. This fails on Python 3.
2012-08-13Refix #13844 -- Made FloatField aggregates work on Python 2.6 + PostgresAnssi Kääriäinen
Fixed a regression introduced in 59a655988ee95e4b4e4646cebea88b620d8fcdd2.
2012-08-12Fixed #18306 -- Made deferred models issue update_fields on saveAndrei Antoukh
Deferred models now automatically update only the fields which are loaded from the db (with .only() or .defer()). In addition, any field set manually after the load is updated on save.
2012-08-12Fixed #13844 -- Avoid converting unknown db values to floatAnssi Kääriäinen
This patch removes an unconditional float(value) conversion from db backend default convert_values() method. This can cause problems when aggregating over character fields for example. In addition, Oracle and SQLite already return the bare value from their convert_values(). In the long term the converting should be done by fields, and the fields should then call database backend specific converters when needed. The current setup is inflexible for 3rd party fields. Thanks to Merlijn van Deen for the original patch.
2012-08-12[py3] Always convert values from sqlite3 to unicode stringsClaude Paroz
Thanks Aymeric Augustin for the review.
2012-08-12[py3] Made __repr__ return str with Python 3Claude Paroz
2012-08-12Fixed #18731 -- Cleaned up split_exclude's use of can_reuseAnssi Kääriäinen
The outer query's set of reusable joins (can_reuse) was passed to the inner query's add_filter call. This was incorrect.
2012-08-12[py3] Refactored __unicode__ to __str__.Aymeric Augustin
* Renamed the __unicode__ methods * Applied the python_2_unicode_compatible decorator * Removed the StrAndUnicode mix-in that is superseded by python_2_unicode_compatible * Kept the __unicode__ methods in classes that specifically test it under Python 2
2012-08-12[py3] Replaced some __str__ methods by __unicode__Aymeric Augustin
These methods actually return unicode.
2012-08-12[py3] Avoided returning bytes in Model.__str__Aymeric Augustin
on Python 3.
2012-08-11[py3] Fixed reraising of exceptionsClaude Paroz
reraise with second argument to None is not supported.
2012-08-10Add db_table and db_tablespace handlingAndrew Godwin
2012-08-10Merge branch 'master' into schema-alterationAndrew Godwin
2012-08-10Add support for unique_togetherAndrew Godwin
2012-08-09[py3] Renamed `next` to `__next__` in iterators.Aymeric Augustin
See PEP 3114. `next` is retained as an alias for Python 2.
2012-08-08[py3] Replaced raw_input by inputClaude Paroz
The six addition has been borrowed from: https://bitbucket.org/gutworth/six/changeset/733ef740
2012-08-08remove a bunch of unnescesarry iterkeys() callsAlex Gaynor
2012-08-08[py3] Replaced __nonzero__ by __bool__Claude Paroz
Of course, __nonzero__ alias has been kept for Python 2 compatibility.
2012-08-08[py3] Fixed a loop that changed dictionary size.Aymeric Augustin
2012-08-07[py3] Applied minor fixes so the test suite startsAymeric Augustin
2012-08-07[py3] Ported django.utils.encoding.Aymeric Augustin
* Renamed smart_unicode to smart_text (but kept the old name under Python 2 for backwards compatibility). * Renamed smart_str to smart_bytes. * Re-introduced smart_str as an alias for smart_text under Python 3 and smart_bytes under Python 2 (which is backwards compatible). Thus smart_str always returns a str objects. * Used the new smart_str in a few places where both Python 2 and 3 want a str.
2012-08-07[py3] Fixed access to dict keys/values/items.Aymeric Augustin
2012-08-06Fixed #18724 -- Fixed IntegerField validation with value 0Brendan MacDonell
2012-08-03Replaced some byte strings by str() callsClaude Paroz
This is a useful trick when Python 2 awaits byte strings and Python 3 Unicode (regular) strings.
2012-08-02Add M2M tests and some unique supportAndrew Godwin
2012-07-26Merge branch 'master' of github.com:django/django into schema-alterationAndrew Godwin
Conflicts: django/db/backends/postgresql_psycopg2/base.py