Commit Graph

1634 Commits

Author SHA1 Message Date
Selwin Ong ea9a0857d4 Fixed #19326 -- Added first() and last() methods to QuerySet 2013-05-21 18:52:28 +03:00
Claude Paroz d595b61aca (Re-)moved some imports 2013-05-21 17:34:19 +02:00
Ramiro Morales 4ba1c2e785 Fixed #9321 -- Deprecated hard-coding of help text in model ManyToManyField fields.
This is backward incompatible for custom form field/widgets that rely
on the hard-coded 'Hold down "Control", or "Command" on a Mac, to select
more than one.' sentence.

Application that use standard model form fields and widgets aren't
affected but need to start handling these help texts by themselves
before Django 1.8.

For more details, see the related release notes and deprecation timeline
sections added with this commit.
2013-05-20 16:29:51 -03:00
Anssi Kääriäinen 266c0bb23e Fixed #20278 -- ensured .get() exceptions do not recurse infinitely
A regression caused by d5b93d3281 made .get() error
reporting recurse infinitely on certain rare conditions. Fixed this by
not trying to print the given lookup kwargs.
2013-05-20 18:50:40 +03:00
Anssi Kääriäinen c9a96075fa Fixed #20378 -- regression in GenericRelation on abstract model
When a GenericRelation was defined on abstract model, queries on childs
of the abstract model didn't work. The problem was in the way fields and
in particular field.rel was copied from models to their children.

The regression was likely caused by #19385. Thanks to Gavin Wahl for
spotting the regression.
2013-05-20 18:02:10 +03:00
Anssi Kääriäinen f53059b411 Fixed qs.values() regression when used in subquery 2013-05-20 15:38:47 +03:00
Aymeric Augustin 6633eeb886 Changed API to disable ATOMIC_REQUESTS per view.
A decorator is easier to apply to CBVs. Backwards compatibility isn't an
issue here, except for people running on a recent clone of master.

Fixed a few minor problems in the transactions docs while I was there.
2013-05-19 19:53:16 +02:00
Aymeric Augustin 181f2ec603 Fixed test failures with Oracle when pytz isn't installed.
Thanks Shai Berger for the report.
2013-05-19 14:38:48 +02:00
Aymeric Augustin f7467181aa Merge pull request #1160 from erikr/host-inet-postgres2
Fixed #11442 -- Postgresql backend casts all inet types to text
2013-05-19 04:57:10 -07:00
Erik Romijn 60d94c2a80 Fixed #11442 -- Postgresql backend casts all inet types to text 2013-05-19 13:28:09 +02:00
Aymeric Augustin a7e2835276 Merge pull request #1028 from manfre/patch-2
Fixed #20340 - document required return value for disable_constraint_checking
2013-05-19 04:17:08 -07:00
Shai Berger 215647c0f7 Fixed #20386 - Introspection problem on Oracle
Made introspection always return a unicode as column name on Oracle.
Thanks aaugustin for review and suggestion to use force_text().
2013-05-18 14:19:26 +03:00
Aymeric Augustin 9c487b5974 Replaced an antiquated pattern.
Thanks Lennart Regebro for pointing it out.
2013-05-17 18:08:58 +02:00
Mike Fogel 74f3884ae0 Fixed #20413 - Respect Query.get_meta() 2013-05-15 12:55:30 -07:00
Aymeric Augustin 3d595c3bc3 Fixed #20215 -- Disabled persistent connections by default. 2013-05-09 15:42:14 +02:00
Alex Gaynor f25fc5b220 Merge pull request #1049 from mfogel/remove-unescessary-parameter-checks
Remove unnecessary check on __set__ parameters.
2013-05-08 21:20:58 -07:00
Aymeric Augustin 86b4ac665a [py3] Stopped iterating on exceptions. Refs #20025. 2013-05-08 13:05:23 +02:00
Aymeric Augustin e81e319f15 Fixed #20025 -- Pointed to a MySQLdb fork for Python 3.
Made a few minor compatibility adjustments.
2013-05-08 13:05:09 +02:00
Aymeric Augustin 1fff8daf88 Fixed test failures on MySQL.
Some tests failed when the time zone definitions were loaded in MySQL
and pytz wasn't installed. This setup isn't supported.
2013-05-08 13:03:36 +02:00
Mike Fogel a22e15effc Remove unnecessary check on __set__ parameters. 2013-05-07 21:50:59 -07:00
Claude Paroz ac9daa0cbd Systematically imported wraps from functools 2013-05-04 11:53:12 +02:00
Adrian Holovaty 6bccbc05a4 Converted a list comprehension into a generator expression in query_utils.py 2013-04-25 12:22:16 -05:00
Adrian Holovaty 5a5e1ac24d Negligible formatting fixes in query_utils.py 2013-04-25 11:42:08 -05:00
Adrian Holovaty 86243d2e57 Removed an errant ipdb import from commit 9777442 2013-04-25 11:41:57 -05:00
Michael Manfre f043cfe3e2 Fixed documentation of disable_constraint_checking
The docstring and base implementation of disable_constraint_checking do not indicate that a return value is expected for proper behavior.
2013-04-24 14:26:13 -03:00
Simon Charette 356443fd95 Use `LOOKUP_SEP` in `get_or_create`. 2013-04-18 01:55:12 -04:00
Tobias McNulty 161c4da588 Fixed #14019 -- Initialize `SQLInsertCompiler.return_id` attribute. 2013-04-08 13:41:36 -06:00
Simon Charette 216580e034 Fixed #20207 -- Handle ManyToManyField with a unicode name correctly. 2013-04-05 15:09:53 -04:00
Alex Gaynor 1aca9d93be Fixed a line that was overindented. 2013-04-04 15:16:16 -07:00
Marti Raudsepp bd9b324a99 Fix typo in transaction.Atomic docstring 2013-04-03 16:49:48 +03:00
Simon Charette 8d05e6c0c7 Fixed deprecation warnings introduced by 97774429ae. 2013-04-01 17:32:09 -04:00
Claude Paroz 8c41bd93c2 Fixed #16737 -- Support non-ascii column names in inspectdb
Thanks moof at metamoof.net for the report.
2013-04-01 19:59:57 +02:00
Claude Paroz 51028f50b6 Fixed getting max_digits for MySQL decimal fields
Refs #5014.
2013-04-01 18:17:00 +02:00
Claude Paroz 3ff3212713 Fixed #19220 -- Prevented decimals to be displayed in scientific notation
Thanks nebstrebor for the report and antofik for the patch.
2013-03-31 22:39:01 +02:00
Claude Paroz 86b1c31689 Fixed #19954 -- Fixed MySQL _last_executed decoding
Queries can contain binary data undecodable with utf-8. In this
case, using the 'replace' errors mode when decoding seems like
an acceptable representation of the query.
Thanks Marcel Ryser for the report.
2013-03-28 20:08:37 +01:00
Gavin Wahl ec04fd1344 Fixed spelling errors 2013-03-28 11:16:53 -06:00
Anssi Kääriäinen e17fa9e877 Fixed #20091 -- Oracle null promotion for empty strings 2013-03-26 14:19:54 +02:00
Anssi Kääriäinen 9c4882b391 Fixed Oracle specific failures in multicolumn joins
Refs #19385
2013-03-24 22:56:40 +02:00
Anssi Kääriäinen 0e0eb8a955 Fixed field.rel.field_name handling
This is a regression fix to multicolumn joins. Refs #19385.
2013-03-24 20:59:56 +02:00
Anssi Kääriäinen 9572a3992b Python 2.6 compatibility for #19385 2013-03-24 19:00:24 +02:00
Anssi Kääriäinen 97774429ae Fixed #19385 again, now with real code changes
The commit of 266de5f9ae included only
tests, this time also code changes included...
2013-03-24 18:40:40 +02:00
Aymeric Augustin e16c48e001 Fixed #15124 -- Changed the default for BooleanField.
Thanks to the many contributors who updated and improved the patch over
the life of this ticket.
2013-03-24 13:47:01 +01:00
Claude Paroz 76aecfbc4b Fixed #9055 -- Standardized behaviour of parameter escaping in db cursors
Previously, depending on the database backend or the cursor type,
you'd need to double the percent signs in the query before passing
it to cursor.execute. Now cursor.execute consistently need percent
doubling whenever params argument is not None (placeholder substitution
will happen).
Thanks Thomas Güttler for the report and Walter Doekes for his work
on the patch.
2013-03-23 17:11:10 +01:00
Marc Tamlyn 829dc3c5a6 Fixed #20094 - Be more careful when checking for Iterator
Python 2.6 has some different behaviour when checking
isinstance(foo, collections.Iterator).
2013-03-22 17:31:29 +01:00
Anssi Kääriäinen 0ff12c28d0 Removed unused import 2013-03-21 00:50:48 +02:00
Claude Paroz 23490a2394 Revert "Fixed 19895 -- Made second iteration over invalid queryset raise an exception too"
This reverts commit 2cd0edaa47.
This commit was the cause of a memory leak. See ticket for more details.
Thanks Anssi Kääriäinen for identifying the source of the bug.
2013-03-20 10:41:53 +01:00
Aymeric Augustin 6197935152 Fixed #19968 -- Dropped support for PostgreSQL < 8.4. 2013-03-18 21:16:29 +01:00
Anssi Kääriäinen f403653cf1 Fixed #19635 -- Made fields pickleable 2013-03-17 15:32:50 +02:00
Aymeric Augustin 3beabb5afd Merge pull request #902 from evildmp/BLANK_CHOICE_NONE
Fixed #20043 -- Removed unused BLANK_CHOICE_NONE
2013-03-17 03:15:49 -07:00
Anssi Kääriäinen 6b4834952d Fixed #16649 -- Refactored save_base logic
Model.save() will use UPDATE - if not updated - INSERT instead of
SELECT - if found UPDATE else INSERT. This should save a query when
updating, but will cost a little when inserting model with PK set.

Also fixed #17341 -- made sure .save() commits transactions only after
the whole model has been saved. This wasn't the case in model
inheritance situations.

The save_base implementation was refactored into multiple methods.
A typical chain for inherited save is:
save_base()
    _save_parents(self)
        for each parent:
            _save_parents(parent)
            _save_table(parent)
    _save_table(self)
2013-03-14 11:01:47 +02:00