Commit Graph

1403 Commits

Author SHA1 Message Date
Tim Graham aa10f57d94 [1.7.x] Fixed #22819 -- Renamed output_type -> output_field in query expression API.
Thanks jorgecarleitao for the suggestion.

Backport of 95cc0e15b4 from master
2014-06-17 12:06:12 -04:00
Craig de Stigter 724e600872 [1.7.x] Fixed #22690 -- Added a check for proxy models containing fields.
Removed the FieldError raised by ModelBase.__new__ in this case.

Backport of ce993efda8 from master
2014-06-02 09:34:31 -04:00
Vincent-Vega d773a08b27 [1.7.x] Fixed #22711 -- Adjusted ordering checks to allow implicit relation fields.
refs #19195.

Backport of d04e730224 from master
2014-06-01 15:37:57 -04:00
Alex Gaynor 3d98941d5c [1.7.x] Fixed several typos in Django
Backport of 1dcc603eff from master
2014-05-29 07:53:02 -04:00
Víðir Valberg Guðmundsson 0ee27d5b62 [1.7.x] Fixed #22720 -- Migrations attempt to create _order twice.
Backport of 6cfa2fae39 from master
2014-05-29 07:52:17 -04:00
Ramiro Morales fb45e666c2 [1.7.x] Fixed #22421 -- Regression in fixtures loading.
Loading fixtures were failing since the refactoring in 244e2b71f5 for
inheritance setups where the chain contains abstract models and the
root ancestor contains a M2M relation.

Thanks Stanislas Guerra for the report.

Refs #20946.

Backport of 862e1ff234 from master
2014-05-22 07:38:39 -04:00
Loic Bistuer 0fa1aeb8d8 [1.7.x] Fixed the ordering of prefetch lookups so that latter lookups can refer to former lookups.
Thanks Anssi Kääriäinen and Tim Graham for the reviews. Refs #17001 and #22650.

Backport of 870b0a1f86 from master
2014-05-21 10:37:41 +07:00
Loic Bistuer 24a41ecc35 [1.7.x] Fixed #22650 -- Fixed regression on prefetch_related.
Regression from f51c1f59 when using select_related then prefetch_related
on the reverse side of an O2O:

Author.objects.select_related('bio').prefetch_related('bio__books')

Thanks Aymeric Augustin for the report and tests. Refs #17001.

Backport of bdf3473e64 from master
2014-05-21 10:37:00 +07:00
Marc Tamlyn c38925a601 [1.7.x] Fixed #22648 -- Transform.output_type should respect overridden custom_lookup and custom_transform.
Previously, class lookups from the output_type would be used, but any
changes to custom_lookup or custom_transform would be ignored.

Backport of a2dd618 from master
2014-05-19 15:05:23 +01:00
Aymeric Augustin e9d0ef19bc [1.7.x] Fixed #22508 -- Avoided overwriting select_related.
Previously, known related objects overwrote related objects loaded
though select_related. This could cancel the effect of select_related
when it was used over more than one level.

Thanks boxm for the bug report and timo for bisecting the regression.

Backport of f574220f from master
2014-05-10 17:03:42 +02:00
Claude Paroz 0d138b9cf4 [1.7.x] Fixed #22564 -- Prevented unneeded bytestrings in migrations
In some cases, this could lead to migrations written with Python 2
being incompatible with Python 3.
Thanks Tim Graham for the report and Loïc Bistuer for the advices.
Backport of da9cf53cb from master.
2014-05-06 09:14:32 +02:00
Claude Paroz e8f1395f4e [1.7.x] Added a bunch of missing unicode_literals
Refs #22564.
Backport of 12474dace from master.
2014-05-06 09:14:03 +02:00
Anssi Kääriäinen 76979a257d [1.7.x] Fixed #22466 -- ordering by reverse foreign key
Ordering by reverse foreign key was broken by custom lookups patch
(commit 20bab2cf9d).

Thanks to everybody who helped solving this issue. Special thanks to
Trac alias takis for reporting this.

Backport of 3b7c66a3ac from master
2014-05-05 15:29:24 +03:00
Jakub Roztocil 4b6ba2c1d1 [1.7.x] Fixed #22489 -- missing implemenation for search lookup
When custom lookups were added, converting the search lookup to use
the new Lookup infrastructure wasn't done.

Some changes were needed to the added test, main change done by
committer was ensuring the test works on MySQL versions prior to 5.6.

Backport of 7131e14d00 from master
2014-05-05 14:40:06 +03:00
Anssi Kääriäinen 402fc4f6c9 [1.7.x] Fixed #22429 -- Incorrect SQL when using ~Q and F
Backport of 5e1f4656b9 from master
2014-05-05 13:06:51 +03:00
Yehonatan Daniv d56267ba57 [1.7.x] Fixed #22539 -- Copied exclude argument in Model.full_clean() to prevent side effects.
Backport of e2e4cdba11 from master
2014-05-01 09:30:49 -04:00
Simon Charette a6ecd5dbb3 [1.7.x] Fixed #19195 -- Allow explicit ordering by a relation `_id` field.
Thanks to chrisedgemon for the report and shaib, akaariai and
timgraham for the review.

Backport of 24ec9538b7 from master
2014-04-30 14:26:39 -04:00
Simon Charette f02f20a739 [1.7.x] Use the new implementation of `six.with_metaclass`.
No more `NewBase` horrors.

Thanks to bendavis78 for his work on merging this into six.

Backport of a2340ac6d6 from master
2014-04-29 10:55:36 -04:00
Alex Gaynor 996564df4d [1.7.x] Fix many many typos in comments throughout the codebase
Backport of 2bcb8bfc8d from master
2014-04-26 14:35:57 -04:00
Erik Romijn 34526c2f56 [1.7.x] Fixed queries that may return unexpected results on MySQL due to typecasting.
This is a security fix. Disclosure will follow shortly.

Backport of 75c0d4ea3a from master
2014-04-21 18:29:39 -04:00
Aymeric Augustin 62eb79fc4c [1.7.x] Appeased flake8 2.1.0.
Backport of 428c0bbe1b from master
2014-04-21 07:50:50 -04:00
Alex Gaynor 50dddbdfc7 [1.7.x] Corrected many style guide violations that the newest version of flake8 catches
Backport of 778ce245dd from master
2014-04-21 07:50:43 -04:00
Justin Hamade 7f8bd1a4b3 [1.7.x] Fixed #22434 -- Retain ordering on related sliced subqueries.
Thanks maciej.pawlisz for the report, and charettes for the review.

Backport of a13df671a5 from master
2014-04-16 18:02:25 -04:00
valtron 6b3a8d2705 [1.7.x] Fixed #21760 -- prefetch_related used an inefficient query for reverse FK.
Regression introduced by commit 9777442. Refs #21410.

Backport of d3b71b976d from master
2014-04-13 00:51:38 +07:00
Shai Berger 3a9a4570ef [1.7.x] Fixed #22343 -- Disallowed select_for_update in autocommit mode
The ticket was originally about two failing tests, which are
fixed by putting their queries in transactions.

Thanks Tim Graham for the report, Aymeric Augustin for the fix,
and Simon Charette, Tim Graham & Loïc Bistuer for review.

Backport of b990df1d63 from master
2014-04-10 01:44:30 +03:00
Simon Charette 4678efd3f1 [1.7.x] Fixed the PostGIS circular imports caused by 1506c71a95.
Thanks to @loic for the help and @timgraham for the review.

refs #12030.

Backport of b9e50e4774 from master
2014-03-26 13:02:52 -04:00
Simon Charette 81d3d48b5e [1.7.x] Fixed field deconstruction tests failures introduced by 1506c71a95.
refs #12030.

Backport of ff874f363c from master
2014-03-25 19:30:33 -04:00
Simon Charette 78211b13a5 [1.7.x] Fixed #12030 -- Validate integer field range at the model level.
Thanks to @timgraham for the review.

Backport of 1506c71a95 from master
2014-03-25 14:31:54 -04:00
Aymeric Augustin 222262ca23 Fixed #22163 -- Stopped ignoring unhandled kwargs in select_for_update. 2014-03-20 22:22:00 +01:00
Marc Tamlyn d22b291890 Fixed #22001 -- Ensure db_type is respected.
db_parameters should respect an already existing db_type method and
return that as its type string. In particular, this was causing some
fields from gis to not be generated.

Thanks to @bigsassy and @blueyed for their work on the patch.

Also fixed #22260
2014-03-14 22:32:17 +00:00
Baptiste Mispelon 37f7f233f5 Fixed #22272 -- Fixed regression in DecimalField when using decimal_places=0.
Thanks to trac user merb for the report.
2014-03-14 17:21:59 +01:00
Shai Berger fc79c3fb3d Flake8 corrections 2014-03-12 20:34:05 +02:00
Akis Kesoglou aaad3e27ac Fixed #22217 - ManyToManyField.through_fields fixes.
- Docs description of arguments mix up.
- Keep it from erroneously masking E332 check.
- Add checks E338 and E339, tweak message of E337.
2014-03-11 19:33:04 -03:00
Daniel Pyrathon 819e09b848 Fixed #22210 -- Saving model instances to non-related fields.
Previously, saving a model instance to a non-related field (in
particular a FloatField) would silently convert the model to an Integer
(the pk) and save it. This is undesirable behaviour, and likely to cause
confusion so the validatio has been hardened.

Thanks to @PirosB3 for the patch and @jarshwah for the review.
2014-03-10 15:25:18 +00:00
Andrew Godwin 40afdaf08c Fix weird autodetector error 2014-03-08 18:35:45 -08:00
Alex Gaynor add1584bfa 4 flake8 warning fixes 2014-03-08 16:17:54 -08:00
Andrew Godwin 6b07804474 Fixed #22183: Through M2Ms now correctly handled 2014-03-08 15:58:04 -08:00
Andrew Godwin cd7a2a077e Fixed #22199: Bad max_length deconstruction for FileField 2014-03-08 13:59:12 -08:00
Claude Paroz 210d0489c5 Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warnings
Thanks Anssi Kääriäinen for the idea and Simon Charette for the
review.
2014-03-08 09:57:40 +01:00
Anssi Kääriäinen 219d928852 Fixed #21863 -- supplemented get_lookup() with get_transform()
Also fixed #22124 -- Expanded explanation of exactly what is going on in
as_sql() methods.
2014-03-07 14:52:13 +00:00
Andrew Godwin 8ce3ea687c Revert "Fixed #22183: Don't make a table for M2Ms with through="
This reverts commit 1562b9896f.
2014-03-06 11:50:04 -08:00
Andrew Godwin 1562b9896f Fixed #22183: Don't make a table for M2Ms with through= 2014-03-06 11:35:58 -08:00
Gabe Jackson b77f26313c Fixed #22207 -- Added support for GenericRelation reverse lookups
GenericRelation now supports an optional related_query_name argument.
Setting related_query_name adds a relation from the related object back to
the content type for filtering, ordering and other query operations.

Thanks to Loic Bistuer for spotting a couple of important issues in
his review.
2014-03-05 22:37:53 +02:00
Akis Kesoglou c627da0ccc Fixed #14549 - Removed restriction of single FKs on intermediary tables
Thanks to Loic Bistuer for review. Minor changes to error messages
done by committer.
2014-03-05 22:33:58 +02:00
Chris Wilson 95c74b9d69 Fixed #22206 -- Passed models.TextField.max_length to forms.CharField.maxlength 2014-03-05 20:09:28 +01:00
Chris Wilson 97a5971324 Fixed typo in internal CharField method 2014-03-04 20:32:54 +01:00
Loic Bistuer 7bbb6958dc Allowed custom querysets when prefetching single valued relations
The original patch for custom prefetches didn't allow usage of custom
queryset for single valued relations (along ForeignKey or OneToOneKey).
Allowing these enables calling performance oriented queryset methods like
select_related or defer/only.

Thanks @akaariai and @timgraham for the reviews. Refs #17001.
2014-03-03 21:35:19 +02:00
Rodolfo Carvalho 0d91225892 Fixed many typos in comments and docstrings.
Thanks Piotr Kasprzyk for help with the patch.
2014-03-03 07:38:09 -05:00
Russell Keith-Magee 82ac389486 Edited model and field checks for grammar and consistency. 2014-03-03 18:18:39 +08:00
Russell Keith-Magee bc4dc6e99c Edited model check messages for grammar and consistency. 2014-03-03 15:35:42 +08:00