Commit Graph

783 Commits

Author SHA1 Message Date
Malcolm Tredinnick 1f770c62da Fix initialisation of ImageField super classes.
Fixes #16548, with thanks to pyriku.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16658 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-23 04:05:47 +00:00
Malcolm Tredinnick 2e56066a5b Fixed an isnull=False filtering edge-case. Fixes #15316.
The bulk of this patch is due to some fine analysis from Aleksandra
Sendecka.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16656 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-23 03:38:42 +00:00
Malcolm Tredinnick c3a0dcf6e9 Added convenience method for viewing Query SQL without params.
This is the old Query.as_sql() method revived: it's like Query.__str__,
but the parameters aren't substituted into the placeholders. Thus, it's
a more accurate representation of the SQL the (default) backend will
see. Entirely internal.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16655 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-23 03:38:28 +00:00
Russell Keith-Magee 3afe409d0e Fixed #14876 -- Ensure that join promotion works correctly when there are nullable related fields. Thanks to simonpercivall for the report, oinopion and Aleksandra Sendecka for the original patch, and to Malcolm for helping me wrestle the edge cases to the ground.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16648 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-22 07:40:12 +00:00
Malcolm Tredinnick c471d471bf Improved error message display during validation errors.
When reporting a validation error (during model validation or fixture
loading, for example), the error messages now report the bad value as
well as the expected type. This can make identifying the offending field
and problem a bit easier.

Fixed #11595. Patch from raulcd and wildfire with supervision from
Russell.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16638 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-22 00:48:53 +00:00
Jannis Leidel 1abafe696e Fixed #14695 -- Stopped model fields from incorrectly overwriting the field name during model initialization if it was already passed as a keyword argument. Thanks, erikrose and willhardy.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16614 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-13 11:53:42 +00:00
Jannis Leidel 1d485cf14f Fixed #10405 -- Raise a more useful error if the formfield of a related model field can't be created yet because the related model isn't loaded yet. Thanks ojii and charstring.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16604 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-12 14:15:08 +00:00
Jannis Leidel bce890ace4 Fixed #16584 -- Fixed a bunch of typos in code comments. Thanks, Bernhard Essl.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16598 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-12 14:14:15 +00:00
Jannis Leidel 50ed810c1f Fixed #16472 -- Removed stale code in the query code. Thanks, fva@chtd.org.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16562 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-29 09:40:09 +00:00
Jannis Leidel dc2bfae1e5 Fixed #16531 -- Fixed various instances of "undefined name" issues. Thanks, Bruno Renié.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16557 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-29 09:39:35 +00:00
Jannis Leidel 24f4764a48 Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for the work on the patch and Alex for reviewing.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-13 09:35:51 +00:00
Ramiro Morales b2050ff546 Fixed #16409 -- Fixed an error condition when using QuerySet only()/defer() on the result of an annotate() call. Thanks jaklaassen AT gmail DOT com and Tai Lee for the reports and Tai for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16522 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-07 01:12:45 +00:00
Jannis Leidel dbffffa7dc Fixed #5535 -- Allow using an explicit foreign key in get() calls. Thanks, Michal Petrucha.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16473 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-28 10:16:18 +00:00
Jannis Leidel 823bac36db Fixed #16246 -- Fixed GenericIPAddressField tests on PostgreSQL.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16395 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-13 20:15:13 +00:00
Karen Tracey 13efd10465 Refs #16234: Avoid GenericIPAddressField clobbering Field default_error_messages dict.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16390 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-13 04:31:56 +00:00
Jannis Leidel ce3c281090 Fixed #811 -- Added support for IPv6 to forms and model fields. Many thanks to Erik Romijn.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16366 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-11 13:48:24 +00:00
Ramiro Morales dff31de20a Fixed #16155 -- Removed Python 2.4 compatibility constructs from code and mentions from docs. Thanks Aymeric Augustin for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16349 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-09 20:01:28 +00:00
Andrew Godwin 865d684a8a Fixed #8913 - Make "must be unique" error messages customisable. Thanks to Leah Culver.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16345 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-09 15:05:13 +00:00
Alex Gaynor fcf8312ade Made clear() on a reverse foreign key significantly more efficient. Thanks to Andrew Godwin for the review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16335 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-07 20:51:59 +00:00
Luke Plant de3b58d626 Fixed #15776 - delete regression in Django 1.3 involving nullable foreign keys
Many thanks to aaron.l.madison for the detailed report and to emulbreh for
the fix.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16295 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-30 16:04:25 +00:00
Ramiro Morales a8598c7de2 Fixed #11789 -- Fixed aggregates so it interacts with QuerySet none() in a way consistent with other empty query sets. Thanks alexr for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16254 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-21 16:54:25 +00:00
Ramiro Morales 15793309e1 Fixed #14476 -- Fixed resolution of automatically generated annotation names so e.g. filtering based on them works. Thanks dirleyls for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16252 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-21 13:12:23 +00:00
Ramiro Morales 07bfc76ecf Fixed #15790 -- Fixed QuerySet only() and defer() methods behavior with proxy models. Thanks Michal Modzelewzki for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-15 00:56:01 +00:00
Luke Plant 385ae343fb Fixed #15709 - Duplicated group_by condition
Thanks to ziangsong for report, and to mk for the patch

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-07 19:02:51 +00:00
Luke Plant db5807bdb1 Fixed #15823 - incorrect join condition when combining Q objects
Thanks to dcwatson for the excellent report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16159 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-05 20:26:26 +00:00
Jannis Leidel 48cffd9e45 Fixed #5931 -- Added __repr__ to db fields. Thanks, Thomas Güttler, emulbreh and magopian.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16145 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-03 11:51:37 +00:00
Jannis Leidel 18d2f4a816 Fixed #5833 -- Modified the admin list filters to be easier to customize. Many thanks to Honza Král, Tom X. Tobin, gerdemb, eandre, sciyoshi, bendavis78 and Julien Phalip for working on this.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16144 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-03 10:44:23 +00:00
Carl Meyer 2706fdbc87 Refs #15093 -- Fixed another get_models call missed in r16053. Thanks Luke for catching it.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16108 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-27 17:51:43 +00:00
Carl Meyer c85b765288 Fixed #15903 -- Allowed not-installed models to still be referenced in related fields. Missed case from r16053.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-27 15:46:43 +00:00
Jannis Leidel c77372cad0 Fixed #14729 -- RawQuerySet.__repr__ fails when params passed as list. Thanks, intgr for ticket and accuser for patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-22 18:17:26 +00:00
Jannis Leidel a845eba8dd Fixed #11283 -- Made sure that latest() clears previously specified ordering in a QuerySet. Thanks to benmoran, punteney, mk and and Julien Phalip.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-22 12:02:07 +00:00
Jacob Kaplan-Moss 8f0f73c7b8 Fixed #2705: added a `select_for_update()` clause to querysets.
A number of people worked on this patch over the years -- Hawkeye, Colin Grady,
KBS, sakyamuni, anih, jdemoor, and Issak Kelly. Thanks to them all, and
apologies if I missed anyone.

Special thanks to Dan Fairs for picking it up again at the end and seeing this
through to commit.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16058 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-20 20:42:07 +00:00
Carl Meyer 6bdaef26ec Fixed #15866, #15850 -- Prevented get_model() and get_models() from returning not-installed models (by default). Thanks adsva for report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16053 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-20 17:58:37 +00:00
Adrian Holovaty 3b6c5e5eb2 Made some negligible docstring fixes while I was poking around in the depths of query.py
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16025 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-11 21:48:47 +00:00
Adrian Holovaty d546179c71 Fixed incorrect usage of its in query.py docstring
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16024 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-11 20:27:53 +00:00
Adrian Holovaty 21877c39b4 Fixed #15743 -- Fixed tense in a docstring in db/models/base.py. Thanks, jMyles
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16006 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02 21:46:28 +00:00
Russell Keith-Magee eea43f2458 Removed deprecated XMLField.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15982 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02 08:39:52 +00:00
Alex Gaynor e57cc90c16 Removed deprecated legacy connection handling for `Field.get_db_*`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15958 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-30 17:48:42 +00:00
Adrian Holovaty 13864703bc Removed a bunch more Python 2.4 workarounds now that we don't support that version. Refs #15702 -- thanks to jonash for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28 02:11:19 +00:00
Adrian Holovaty 15295a852f Fixed #15647 -- Changed in_bulk() not to type check its input, which now allows for passing any iterable. Thanks, calvinspealman
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-26 17:50:10 +00:00
Jacob Kaplan-Moss fd2f18008c Fixed #14733: no longer "validate" .raw() queries.
Turns out that a lot more than just SELECT can return data, and this list is
very hard to define up front in a cross-database manner. So let's just assume
that anyone using raw() is at least halfway competant and can deal with
the error messages if they don't use a data-returning query.

Thanks to Christophe Pettus for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-14 19:49:53 +00:00
Adrian Holovaty e494f88be0 Fixed #15601 -- Corrected a weird typo. Thanks, jMyles
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15800 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-14 05:45:55 +00:00
Adrian Holovaty 72c5733869 Fixed #15604 -- Changed django.db.models.permalink to use wraps() so that it doesn't eat the docstring. Thanks for the report, sfllaw. Also added tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15798 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-14 05:22:39 +00:00
Luke Plant 0a3aae8362 Fixed #15559 - distinct queries introduced by [15607] cause errors with some custom model fields
This patch just reverts [15607] until a more satisfying solution can be
found.

Refs #11707

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15791 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-10 01:15:19 +00:00
Russell Keith-Magee b7c41c1fbb Fixed #12252 -- Ensure that queryset unions are commutative. Thanks to benreynwar for the report, and draft patch, and to Karen and Ramiro for the review eyeballs and patch updates.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15726 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03 13:51:54 +00:00
Russell Keith-Magee d1290b5b43 Fixed #3094 -- Accelerated deprecation of XMLField, since it hasn't served any useful purpose since oldforms. Thanks to PaulM for driving the issue and providing the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03 13:28:20 +00:00
Luke Plant 6902824ac2 Fixed #11707 - limit_choices_to on a ForeignKey can render duplicate options in formfield
Thanks to Chris Wesseling for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15607 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-21 14:03:59 +00:00
Russell Keith-Magee 492b8a0821 Fixed #13987 -- Ensure that the primary key is set correctly for all models that have concrete-abstract-concrete inheritance, not just the first model. Thanks to Aramgutang for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15498 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-12 15:07:27 +00:00
Russell Keith-Magee 337a6bc0f6 Fixed #15283 -- Made a minor performance tweak to __iter__. Thanks to lanyjie for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15491 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-12 05:23:41 +00:00
Russell Keith-Magee d3b38d578f Fixed #13815 -- Ensure that reverse exclude lookups on nullable foreign keys exclude null values. Thanks to bpeschier for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15458 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-08 14:06:02 +00:00