Commit Graph

3259 Commits

Author SHA1 Message Date
Sjoerd Job Postmus 2f18cbc313 [1.10.x] Fixed #27026 -- Fixed state initialization of bulk_create() objects if can_return_ids_from_bulk_insert.
Backport of 3246d2b4bb from master
2016-08-06 10:25:29 -04:00
Jarek Glowacki 1e16e141ac [1.10.x] Fixed #27004 -- Made migrations consistency check ignore unapplied squashed migrations.
Backport of d117567c7d from master
2016-08-05 18:11:38 -04:00
Claude Paroz 6757c94662 [1.10.x] Fixed #26983 -- Fixed isnull filtering on ForeignKey with to_field
Thanks weidwonder for the report.
Backport of 272eccf7ff from master.
2016-08-04 16:07:11 +02:00
Tim Graham 11c5c3b801 [1.10.x] Fixed #26991 -- Fixed a crash in MySQL where SELECT @@SQL_AUTO_IS_NULL doesn't return a result.
Backport of 431cbd115b from master
2016-08-02 10:52:49 -04:00
Tim Graham 83b950e9ff [1.10.x] Refs #25550 -- Corrected deprecation message for assigning M2M relations.
Backport of 5fa4370543 from master
2016-07-30 20:50:54 -04:00
Simon Charette dcf0a35b08 [1.10.x] Fixed #26916 -- Fixed prefetch_related when using a cached_property as to_attr.
Thanks Trac alias karyon for the report and Tim for the review.

Backport of 271bfe65d9 from master
2016-07-19 16:09:23 -04:00
Tim Graham a03ac61332 [1.10.x] Fixed #26900 -- Fixed crash accessing deferred FileFields.
Backport of 7c33aa8a87 from master
2016-07-16 08:47:29 -04:00
Marc-Aurèle Brothier a8b2445a78 [1.10.x] Fixed #26868 -- Changed MySQL version detection to use a query.
Workaround a bug with MariaDB and MySQL native client not stripping the
`5.5.5-` prefix.

Backport of f8bfa80680 from master
2016-07-15 10:22:28 -04:00
Tim Graham 5c56ce7a3f [1.10.x] Reverted "Fixed #25388 -- Added an option to allow disabling of migrations during test database creation"
This reverts commit 157d7f1f1d since it
disables migrations all the time, not just during tests.

Backport of 944e66cb1d from master
2016-07-14 09:22:06 -04:00
Jon Dufresne 1a2ee697e0 [1.10.x] Fixed #26889 -- Fixed missing PostgreSQL index in SchemaEditor.add_field().
Backport of 2e4cfcd2b9 from master
2016-07-13 21:55:25 -04:00
Andrey Fedoseev ded5020241 [1.10.x] Fixed #17657 -- Made ModelForm respect ModelMultipleChoiceField's to_field_name.
Follow up to 67d984413c.

Backport of 81963b37a9 from master
2016-07-12 16:20:28 -04:00
Julien Hartmann 39c25b772b [1.10.x] Fixed #26749 -- Preserved behavior of use_for_related_field during deprecation.
Backport of f4afb85d7e from master
2016-07-11 13:34:18 -04:00
Loïc Bistuer a2af2420ce [1.10.x] Fixed #26881 -- Fixed duplicate managers in migrations.
When both parent and child models had managers with the same name and
a migrations opt-in both were added to the migration state.

Backport of dab83e5ba1 from master
2016-07-09 18:12:18 +07:00
Andrew Nester f683bba6f6 [1.10.x] Fixed #25292 -- Fixed crash in ManyToManyField.through_fields check.
Backport of baff4dd37d from master
2016-06-30 08:55:21 -04:00
Eduard Stepanov 28de25c249 [1.10.x] Fixed #26786 -- Avoided redundant max value validators on integer fields.
Backport of 49b4596cb4 from master
2016-06-28 11:40:59 -04:00
Aaron Elliot Ross 198128684b [1.10.x] Fixed #26171 -- Made MySQL create an index on ForeignKeys with db_contraint=False.
Refactored "Prevented unneeded index creation on MySQL-InnoDB" (2ceb10f)
to avoid setting db_index=False.

Backport of 6bf7964023 from master
2016-06-28 08:22:36 -04:00
Simon Charette 23ac35af19 [1.10.x] Fixed #26781 -- Made table name case change a noop on SQLite.
SQLite disgresses from the SQL standard by ignoring case of quoted identifiers.

Thanks to laozzzi for the report and Tim for the review.

Backport of c2e62fd1ae from master
2016-06-21 16:38:00 -04:00
Loïc Bistuer 0f23bcebdf [1.10.x] Fixed #26643 -- Prevented unnecessary AlterModelManagers operations caused by the manager inheritance refactor.
This also makes migrations respect the base_manager_name and
default_manager_name model options.

Thanks Anthony King and Matthew Schinckel for the initial patches.

Backport of 2eb7cb2fff from master
2016-06-20 12:56:37 -04:00
Tim Graham 91d754eb2a [1.10.x] Fixed #26778 -- Fixed ModelSignal.connect() weak argument.
Backport of 9bf8d50a67 from master
2016-06-18 20:45:58 -04:00
Tim Graham bdc29b7188 [1.10.x] Reverted "Fixed #26398 -- Made FieldFile.open() respect its mode argument."
This reverts commit a52a531a8b due to
regressions described in refs #26772.

Backport of 7def55c3f6 from master
2016-06-17 21:08:56 -04:00
Ville Skyttä efe9874371 [1.10.x] Fixed broken links in docs and comments.
Backport of 96f97691ad from master
2016-06-15 21:20:38 -04:00
Paulo 34f13e030b [1.10.x] Fixed typos in db/models/fields/related_descriptors.py
Backport of 1a2a7cc01e and
908c26b079 from master
2016-06-07 08:53:49 -04:00
Tim Graham 8996054cb4 [1.10.x] Fixed #26667 -- Fixed a regression in queries on a OneToOneField that has to_field and primary_key=True.
Thanks Simon Charette for review.

Backport of e2296e7f0a from master
2016-06-04 09:15:10 -04:00
mieciu 9a204fc8a5 [1.10.x] Fixed #26698 -- Fixed PostgreSQL dbshell crash on an empty database name.
Backport of 19ff506878 from master
2016-06-03 12:42:41 -04:00
Alex Hill 85d2b80d5e [1.10.x] Fixed #26686 -- Fixed crash when registering model signals with abstract senders.
Backport of 08014fe75b from master
2016-06-02 14:46:44 -04:00
Alex Hill f91247f598 [1.10.x] Fixed #26642 -- Made ModelSignal.disconnect() work with lazy references.
Backport of ff6c6feae1 from master
2016-06-02 14:46:31 -04:00
Simon Charette 58f0d40b6d [1.10.x] Fixed #26676 -- Prevented prefetching to_attr from caching its result in through attr.
Thanks Ursidours for the report.

Backport of 53a5fb3cc0 from master
2016-05-31 14:35:20 -04:00
Vytis Banaitis b737c0f5db [1.10.x] Fixed #25044 -- Fixed migrations for renaming ManyToManyField's through model.
Backport of f1e408ff40 from master
2016-05-30 10:27:28 -04:00
Tim Graham f529d0cb58 [1.10.x] Refs #24227 -- Fixed crash of ManyToManyField.value_from_object() on unsaved model instances.
This behavior was removed in 67d984413c
but is needed to prevent a crash in formtools.

Backport of a4c20ae85b from master
2016-05-28 16:06:06 -04:00
Simon Charette dfae72f45a [1.10.x] Fixed #26647 -- Included the state of all applied migrations when migrating forward.
Thanks Jasper Maes for the detailed report.

Backport of 36d36818a3 from master
2016-05-26 13:32:02 -04:00
Alex Hill 779bb82f51 Fixed #26421 -- Refactored ModelSignal to use Apps.lazy_model_operation() 2016-05-19 21:33:36 -04:00
Alex Hill 2ff7ef15b0 Refs #26421 -- Refactored Apps.lazy_model_operation() for better checks and tests 2016-05-19 21:33:36 -04:00
Tim Graham 546649f2d6 Fixed some newlines in imports per isort. 2016-05-19 11:05:44 -04:00
darius BERNARD a7ad473ad2 Fixed #26515 -- Fixed Query.trim_joins() for nested ForeignObjects. 2016-05-19 09:56:24 -04:00
Marti Raudsepp b9ae662c97 Fixed #26620 -- Made Model.refresh_from_db() fail when passed unknown kwargs. 2016-05-18 09:27:23 -04:00
Barthelemy Dagenais a5c8072ab1 Fixed #26627 -- Fixed on_commit callbacks execution order when callbacks make transactions. 2016-05-18 09:09:48 -04:00
Josh Smeaton 2a4af0ea43 Fixed #25774 -- Refactor datetime expressions into public API 2016-05-18 20:14:58 +10:00
Josh Smeaton 77b73e79a4 Refs #25774 -- Made Oracle truncate microseconds if USE_TZ=False.
The tests for this change are in the fix for #25774.
2016-05-18 20:14:58 +10:00
Philip Liberato 3630b49b55 Fixed #26613 -- Made sqlite3 optional in SchemaEditor.quote_value(). 2016-05-17 21:43:37 -04:00
boaz85@gmail.com 5f23f904af Fixed #14415 -- Used the test database name in BaseDatabaseCreation.test_db_signature(). 2016-05-17 21:35:36 -04:00
Loïc Bistuer ed0ff913c6 Fixed #10506, #13793, #14891, #25201 -- Introduced new APIs to specify models' default and base managers.
This deprecates use_for_related_fields.

Old API:

class CustomManager(models.Model):
    use_for_related_fields = True

class Model(models.Model):
    custom_manager = CustomManager()

New API:

class Model(models.Model):
    custom_manager = CustomManager()

    class Meta:
        base_manager_name = 'custom_manager'

Refs #20932, #25897.

Thanks Carl Meyer for the guidance throughout this work.
Thanks Tim Graham for writing the docs.
2016-05-17 12:07:22 +07:00
Loïc Bistuer 3a47d42fa3 Fixed #20932, #25897 -- Streamlined manager inheritance. 2016-05-17 02:29:22 +07:00
Aron Podrigal 85ef98dc6e Fixed #24305 -- Allowed overriding fields on abstract models.
Fields inherited from abstract base classes may be overridden like
any other Python attribute. Inheriting from multiple models/classes
with the same attribute name will follow the MRO.
2016-05-16 07:32:21 -04:00
Simon Charette f937c9ec97 Fixed #24100 -- Made the migration signals dispatch its plan and apps.
Thanks Markus for your contribution and Tim for your review.
2016-05-15 19:51:15 -04:00
Tim Graham cb4be0262a Removed unused code in AlterField.database_forwards().
This code added in 107c9f5453 isn't
used after 4ce7a6bc84.
2016-05-14 06:43:40 -04:00
Tim Graham 3642835bde Removed redundant code in QuerySet._batched_insert(). 2016-05-14 06:42:50 -04:00
Simon Charette c0118ff80b Refs #24201 -- Ignored order_with_respect_to private fields in migrations.
Thanks Tim for the review.
2016-05-13 15:43:23 -04:00
Tim Graham 67d984413c Refs #24227 -- Removed ManyToManyField special casing in model_to_dict(). 2016-05-11 10:12:59 -04:00
Raphael Gaschignard 8f6a1a1551 Fixed #26429 -- Added a timestamp to merge migration names.
This reduces the possibility of a naming conflict, especially after
squashing migrations.
2016-05-11 08:19:19 -04:00
Iacopo Spalletti 49c57f8565 Fixed #25005 -- Made date and time fields with auto_now/auto_now_add use effective default.
Thanks to Andriy Sokolovskiy for initial patch.
2016-05-09 07:48:40 -04:00