Commit Graph

2392 Commits

Author SHA1 Message Date
Andrew Godwin 5400b29ebf Fixed #22325: Ignore __first__ dependencies to your own app 2014-05-08 21:38:56 -07:00
Andrew Godwin 5182efce8d Fixed #22563: Ignore AUTH_USER_MODEL errors in from_state 2014-05-08 21:34:30 -07:00
Aymeric Augustin 99d9fa329a Added feature flags for introspection capabilities. 2014-05-08 22:11:20 +02:00
Aymeric Augustin cff59bedc2 Split ignores_nulls_in_unique_constraints feature.
Oracle and SQL Server don't have exactly the same limitations. It's
worth treating them differently.
2014-05-08 22:11:20 +02:00
Aymeric Augustin c70a61eb49 Replaced vendor checks by three feature flags. 2014-05-08 22:11:15 +02:00
Aymeric Augustin b1432bfc22 Appeased flake8. 2014-05-08 21:49:54 +02:00
Andrew Godwin b25aee3b7b Fixed #22476: Couldn't alter attributes on M2Ms with through= set 2014-05-08 10:34:24 -07:00
Andrew Godwin 5a917cfef3 Fixed #22496: Data migrations get transactions again! 2014-05-07 14:28:34 -07:00
Andrew Godwin e9a456d11b Fixed #22581: Pass default values for schema through get_db_prep_save() 2014-05-07 13:46:23 -07:00
Andrew Godwin fc974313b8 Fixed #22563: Better error message when trying to change AUTH_USER_MODEL
You're not allowed to do this after you've made migrations; see ticket
for more details.
2014-05-07 13:05:11 -07:00
Andrew Godwin f9d7e18dc5 Fixed #22576: Ensure makemigrations doesn't touch the database. 2014-05-06 22:41:59 -07:00
Claude Paroz da9cf53cb5 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.
2014-05-06 09:13:07 +02:00
Claude Paroz 12474dacef Added a bunch of missing unicode_literals
Refs #22564.
2014-05-06 09:13:07 +02:00
Anssi Kääriäinen 3b7c66a3ac 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.
2014-05-05 15:28:07 +03:00
Jakub Roztocil 7131e14d00 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.
2014-05-05 14:36:15 +03:00
Anssi Kääriäinen 5e1f4656b9 Fixed #22429 -- Incorrect SQL when using ~Q and F 2014-05-05 13:02:11 +03:00
Claude Paroz faa8c71fd9 Moved misplaced transaction.atomic from 0dce44e16b
Thanks Florian Apolloner for noticing the issue and Aymeric
Augustin for the expertise.
Refs #22540.
2014-05-03 23:44:40 +02:00
Tim Graham 3818d96426 Fixed #22435 -- Prevented adding a ManyToManyField from prompting for a default.
Thanks andrewsg for the report.
2014-05-02 20:46:47 -04:00
Claude Paroz 0dce44e16b Fixed #22540 -- Made _create_object_from_params() call create()
So as the save step is centralized in create(), especially useful
when customizing behavior in subclasses.
Thanks craig.labenz@gmail.com for the report.
2014-05-02 09:06:15 +02:00
Chris Beaven a0c4b8465d Fix migration autodector to work correctly with custom deconstructed values 2014-05-02 15:08:19 +12:00
Yehonatan Daniv e2e4cdba11 Fixed #22539 -- Copied exclude argument in Model.full_clean() to prevent side effects. 2014-05-01 09:28:11 -04:00
Tim Graham 45c2d1f5d9 flake8 fixes. 2014-04-30 18:33:46 -04:00
Andrew Godwin 8f6dff372b Fixed #22485: Include all unmigrated apps in project state by default. 2014-04-30 12:25:12 -07:00
Simon Charette 24ec9538b7 Fixed #19195 -- Allow explicit ordering by a relation `_id` field.
Thanks to chrisedgemon for the report and shaib, akaariai and
timgraham for the review.
2014-04-30 14:23:19 -04:00
Claude Paroz 7c54f8cced Fixed #22474 -- Made migration recorder aware of multiple databases
Thanks Tim Graham for the review.
2014-04-30 16:53:20 +02:00
Simon Charette a2340ac6d6 Use the new implementation of `six.with_metaclass`.
No more `NewBase` horrors.

Thanks to bendavis78 for his work on merging this into six.
2014-04-29 09:43:08 -04:00
Alex Gaynor 2bcb8bfc8d Fix many many typos in comments throughout the codebase 2014-04-26 10:18:45 -07:00
Aymeric Augustin 8b5b199e20 Fixed #3214 -- Stopped parsing SQL with regex.
Avoided introducing a new regex-based SQL splitter in the migrations
framework, before we're bound by backwards compatibility.

Adapted this change to the legacy "initial SQL data" feature, even
though it's already deprecated, in order to facilitate the transition
to migrations.

sqlparse becomes mandatory for RunSQL on some databases (all but
PostgreSQL). There's no API to provide a single statement and tell
Django not to attempt splitting. Since we have a more robust splitting
implementation, that seems like a good tradeoff. It's easier to add a
new keyword argument later if necessary than to remove one.

Many people contributed to both tickets, thank you all, and especially
Claude for the review.

Refs #22401.
2014-04-26 17:46:23 +02:00
Aymeric Augustin 3033a7193a Fixed #21166 -- Reset errors_occurred flag after commit and rollback. 2014-04-25 22:45:11 +02:00
Aymeric Augustin e368912902 Set some transaction-related feature flags on SQLite.
Refs #22496.
2014-04-25 11:43:20 +02:00
Shai Berger 843613add4 Fixed #22498 -- constraint name was not quoted in FK creation SQL 2014-04-25 01:30:43 +03:00
Shai Berger 53d97e4fe3 Made sure cursor.close() does not complain if cursor is already closed on Oracle
Refs #22483
2014-04-25 00:36:40 +03:00
Aymeric Augustin 25209715d4 Prevented a crash in the cursor wrappers on Oracle.
Fixed #22483 (again).

Forwardport of 5cd6429620 from stable/1.7.x
2014-04-24 09:14:42 -04:00
Aymeric Augustin b0f4eecfa7 Ignored repeated calls to connection.close().
Forwardport of 9bbb43dd1a from stable/1.7.x
2014-04-24 09:14:26 -04:00
Aymeric Augustin 0aa4c6c391 Used the same instance of atomic for entry and exit.
Since all state is maintained on the connection at this time and none in
the atomic, it doesn't matter, but it could introduce some subtle bugs
if the implementation changed in the future.
2014-04-23 21:44:36 +02:00
Aymeric Augustin e74d2183c2 Wrapped migrations in a transaction only on DBs with transactional DDL. 2014-04-23 21:44:36 +02:00
Erik Romijn 75c0d4ea3a Fixed queries that may return unexpected results on MySQL due to typecasting.
This is a security fix; disclosure to follow shortly.
2014-04-21 18:11:26 -04:00
Aymeric Augustin 428c0bbe1b Appeased flake8 2.1.0. 2014-04-21 12:27:34 +02:00
Tim Graham 471fb04a30 Fixed flake8 errors. 2014-04-20 13:08:04 -04:00
Andrew Gorcester 956bd64424 Fixed #22397 -- Issues removing M2M field with explicit through model
Changed the migration autodetector to remove models last so that FK
and M2M fields will not be left as dangling references. Added a check
in the migration state renderer to error out in the presence of
dangling references instead of leaving them as strings. Fixed a bug
in the sqlite backend to handle the deletion of M2M fields with
"through" models properly (i.e., do nothing successfully).

Thanks to melinath for report, loic for tests and andrewgodwin and
charettes for assistance with architecture.
2014-04-18 16:44:47 -04:00
Simon Charette 0d397e5a5b Revert "Fixed #22397 -- Issues removing M2M field with explicit through model."
This reverts commit 00e3b9a2a9.

It's causing a regression when tested with the proxy_model_inheritance tests.
2014-04-18 01:27:30 -04:00
Andrew Gorcester 00e3b9a2a9 Fixed #22397 -- Issues removing M2M field with explicit through model.
Changed the migration autodetector to remove models last so that FK
and M2M fields will not be left as dangling references. Added a check
in the migration state renderer to error out in the presence of
dangling references instead of leaving them as strings. Fixed a bug
in the sqlite backend to handle the deletion of M2M fields with
"through" models properly (i.e., do nothing successfully).

Thanks to melinath for report, loic for tests and andrewgodwin and
charettes for assistance with architecture.
2014-04-17 12:54:35 -04:00
Justin Hamade a13df671a5 Fixed #22434 -- Retain ordering on related sliced subqueries.
Thanks maciej.pawlisz for the report, and charettes for the review.
2014-04-16 17:57:11 -04:00
Simon Charette 79f05616fb Fixed flake8 warnings introduced in recent commits. 2014-04-16 16:49:37 -04:00
Motiejus Jakštys 0e45669fa9 Fixed #22460 -- Explicity remove constraints when dropping a related field. 2014-04-16 15:38:31 -04:00
Marc Egli 0bcc92c691 Fixed #22356 -- Added a check to make sure unique_together fields are local. 2014-04-14 16:49:40 -04:00
Simon Charette 72d3889db4 Fixed #22350 -- Consistently serialize bytes and text in migrations.
Thanks to @treyhunner and Loïc for their suggestions and review.
2014-04-13 18:22:26 -04:00
valtron d3b71b976d Fixed #21760 -- prefetch_related used an inefficient query for reverse FK.
Regression introduced by commit 9777442. Refs #21410.
2014-04-13 00:34:16 +07:00
Aymeric Augustin 476db08b16 Improved a comment. Thanks intgr for the report. 2014-04-11 23:01:00 +02:00
Aymeric Augustin ee837b9a22 Increased robustness of 58161e4e. Refs #22291. 2014-04-10 21:22:47 +02:00
Aymeric Augustin 8176150850 Fixed #21202 -- Maintained atomicity when the server disconnects.
Thanks intgr for the report.

This commit doesn't include a test because I don't know how to emulate a
database disconnection in a cross-database compatible way.

Also simplified a 'backends' test that was constrained by this problem.
2014-04-10 21:22:47 +02:00
Aymeric Augustin 25860096f9 Fixed #21239 -- Maintained atomicity when closing the connection.
Refs #15802 -- Reverted #7c657b24 as BaseDatabaseWrapper.close() now
has a proper "finally" clause that may need to preserve self.connection.
2014-04-10 20:57:43 +02:00
Aymeric Augustin 3becac8484 Fixed #22321 -- Wrapped exceptions in _set_autocommit.
Refs #21202.
2014-04-10 20:16:12 +02:00
Shai Berger f095356ba2 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.
2014-04-10 03:04:51 +03:00
Aymeric Augustin 5f2f47fdfc Fixed #21553 -- Ensured unusable database connections get closed. 2014-04-09 22:41:33 +02:00
Claude Paroz 0a65da941c Fixed #22236 -- Removed inappropriate usage of signals
Thanks Aymeric Augustin for the report and Tim Graham for the review.
2014-04-05 21:00:31 +02:00
Simon Charette 074d3183d9 Fixed #22363 -- Correctly serialize `django.utils.datetime_safe` objects.
Thanks to linovia for the report.
2014-04-03 14:54:16 -04:00
Loic Bistuer 0fd51cf0bd Fixed #22319 -- Fixed migration external dependencies when there are internal dependencies. 2014-03-31 06:50:38 -04:00
Loic Bistuer a449e7feec Fixed #22359 -- Changing M2M field to blank=True failed on sqlite. 2014-03-31 06:13:19 -04:00
Alex Gaynor 778ce245dd Corrected many style guide violations that the newest version of flake8 catches 2014-03-30 12:11:05 -07:00
Loic Bistuer 20399083f4 Fixed #19816 -- Pre-evaluate querysets used in direct relation assignments.
Since assignments on M2M or reverse FK descriptors is composed of a `clear()`,
followed by an `add()`, `clear()` could potentially affect the value of the
assigned queryset before the `add()` step; pre-evaluating it solves the problem.

This patch fixes the issue for ForeignRelatedObjectsDescriptor,
ManyRelatedObjectsDescriptor, and ReverseGenericRelatedObjectsDescriptor.
It completes 6cb6e1 which addressed ReverseManyRelatedObjectsDescriptor.
2014-03-30 15:36:45 +07:00
Loic Bistuer bc9be72bdc Fixed transaction handling for a number of operations on related objects.
Thanks Anssi and Aymeric for the reviews. Refs #21174.
2014-03-30 12:13:00 +07:00
Chris Beaven b077ba7ac1 Add a useful stacklevel to some RemovedInDjango19Warnings 2014-03-27 15:44:52 +13:00
Simon Charette b9e50e4774 Fixed the PostGIS circular imports caused by 1506c71a95.
Thanks to @loic for the help and @timgraham for the review.

refs #12030.
2014-03-26 12:57:57 -04:00
Simon Charette ff874f363c Fixed field deconstruction tests failures introduced by 1506c71a95.
refs #12030.
2014-03-25 18:54:52 -04:00
Tim Graham 42336c84a0 Fixed #22331 -- Made MigrationAutodetector ignore unmanaged models.
This commit reverts 69d4b1c and tackle the issue from a different angle.
Models remain present in the project state, but are now ignored by the
autodetector.
2014-03-25 18:30:58 -04:00
Simon Charette 1506c71a95 Fixed #12030 -- Validate integer field range at the model level.
Thanks to @timgraham for the review.
2014-03-25 14:31:20 -04:00
Loic Bistuer 69d4b1c3ea Fixed #22331 -- Fixed migrations ProjectState to ignore unmanaged models. 2014-03-25 10:33:44 -04:00
Stephen Burrows 35ed792cf2 Fixed #22300 -- Fixed crash in migrations when changing non-relational field to relational. 2014-03-25 07:46:15 -04:00
Daniel Hahler 1edfa155e3 Fixed #22293 -- Avoided renaming many-to-many tables to themselves.
Fixed this for both implementations of _alter_many_to_many, instead of
in `alter_db_table` itself (more implementations).
2014-03-24 13:24:52 -04:00
Aymeric Augustin 58161e4e93 Fixed #22291 -- Avoided shadowing deadlock exceptions on MySQL.
Thanks err for the report.
2014-03-23 20:45:22 +01:00
Tim Graham 80e6960580 Removed unused imports. 2014-03-21 20:18:19 -04:00
Aymeric Augustin 7e0f9095f7 Removed BaseDatabaseCreation.set_autocommit per deprecation timeline. 2014-03-21 22:17:36 +01:00
Aymeric Augustin 6993f2886b Fixed typo in comments. 2014-03-21 22:16:31 +01:00
Aymeric Augustin 051c666aca Removed django.db.backend per deprecation timeline. 2014-03-21 22:16:14 +01:00
Aymeric Augustin 06160cb945 Removed deprecated TRANSACTIONS_MANAGED setting. 2014-03-21 21:34:47 +01:00
Aymeric Augustin 0f9560855e Removed legacy transaction management per the deprecation timeline. 2014-03-21 21:06:50 +01:00
Tim Graham f6c1f05fbf Removed Model._meta.module_name per deprecation timeline.
refs #19689.
2014-03-21 11:10:34 -04:00
Tim Graham 4965a77407 Removed PIL compatability layer per deprecation timeline.
refs #19934.
2014-03-21 10:54:53 -04:00
Tim Graham 99339c77f6 Removed Model._meta.get_(add|change|delete)_permission methods per deprecation timeline. 2014-03-21 08:27:37 -04:00
Tim Graham bcc15e2b21 Removed backward compatible shims to rename get_query_set and similar queryset methods.
Also removed the backward compatible shims introduced to rename the
attributes ChangeList.root_query_set and ChangeList.query_set.
2014-03-21 07:47:25 -04:00
Aymeric Augustin 222262ca23 Fixed #22163 -- Stopped ignoring unhandled kwargs in select_for_update. 2014-03-20 22:22:00 +01:00
Andrew Godwin 831ce69cbb Mark model renaming as irreversible for now (#22248) 2014-03-19 21:25:26 -07:00
Andrew Godwin 81f5408c7a Fixed #22275: unique_together broken if ForeignKey split into new file.
Thanks to bak1an for the patch.
2014-03-19 21:23:21 -07:00
Chris Beaven b47ef04ea2 Fix any sqlite field migration deleting all implicit m2m tables
Fixes #22281
2014-03-18 16:54:35 +13: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 6983201cfb Fixed #20292: Pass datetime objects (not formatted dates) as params to Oracle
This seems worthwhile in its own right, but also works around an Oracle
bug (in versions 10 -- 11.1) where the use of Unicode would reset the
date/time formats, causing ORA-01843 errors.

Thanks Trac users CarstenF for the report, jtiai for the initial patch,
and everyone who contributed to the discussion on the ticket.
2014-03-12 23:43:45 +02: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
Chris Beaven 107c9f5453 Fix AlterField migrations that are related to a RenameModel migration 2014-03-11 17:13:26 +13:00
Chris Beaven 40f6ca54f8 Fix autodetector creation of RenameModel migration to capitalize model names 2014-03-11 12:23:45 +13: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
Chris Beaven 7feb70eef3 Fixed #22239 -- Add auto detection of renamed models 2014-03-10 13:55:44 +13:00
Shai Berger deff74ea0c Fixed the last fix for database test settings to work with Python3. 2014-03-09 12:27:12 +02:00
Shai Berger 84c137490b Fixed test breakage following test-settings enhancements 2014-03-09 10:23:47 +02:00
Andrew Godwin 40afdaf08c Fix weird autodetector error 2014-03-08 18:35:45 -08:00
Shai Berger 41afae4ce9 Reorganized the database test settings
Change database test settings from "TEST_"-prefixed entries in the
database settings dictionary to setting in a dictionary that is itself
an entry "TEST" in the database settings.

Refs #21775

Thanks Josh Smeaton for review.
2014-03-09 03:57:18 +02: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 cdf6eba181 Merge pull request #2315 from bendavis78/issues/22073
Fixed #22073 - Ensure CreateTable operation handles backwards migration correctly when M2M fields are present
2014-03-08 15:44:45 -08:00
Andrew Godwin cd7a2a077e Fixed #22199: Bad max_length deconstruction for FileField 2014-03-08 13:59:12 -08:00
Andrew Godwin 28779abb75 Fix bad conflict detection during makemigrations 2014-03-08 13:53:20 -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 1232acb884 Don't allow really long migration names 2014-03-06 13:34:31 -08:00
Andrew Godwin e46e15e5a1 Fixed #22204: Bad circular-dep-breaking if more than one per run 2014-03-06 13:22:42 -08: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
Alex Gaynor a248c88372 Fixed three small flake8 violations. 2014-03-04 15:13:15 -08:00
Andrew Godwin 8fcc0140d0 Merge pull request #2396 from loic/ticket21893
Fixed #21893 -- ModelState didn't account for MTI parents inherited from abstract models.
2014-03-04 12:33:51 -08:00
Loic Bistuer 6436f1fad9 Fixed #21893 -- ModelState didn't account for MTI parents inherited from abstract models. 2014-03-05 03:25:14 +07: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
Russell Keith-Magee f7587b20da Edited MySQL-specific check messages for grammar and consistency. 2014-03-03 14:31:55 +08:00
Aymeric Augustin 7ba29189fa Restored aliases for two APIs removed by app-loading. 2014-03-02 14:01:52 +01:00
Anubhav Joshi bb2ca9fe6c Fixed #22172 -- Allowed index_together to be a single list (rather than list of lists)..
Thanks EmilStenstrom for the suggestion.
2014-03-01 15:44:42 -05:00
Baptiste Mispelon c679cb7f60 Fixed #22168 -- Fixed migrations failing on sqlite when column names are SQL keywords
Thanks to trac user fallen_flint for the report and initial patch.
2014-03-01 13:45:45 +01:00
Andrew Godwin cbd04c7c49 Fix keyword agument names in RunPython to be positional 2014-02-28 09:22:48 -08:00
Martin Matusiak 48a8b714d4 Fixed bad grammar in a comment. 2014-02-25 21:02:35 -05:00
Andrew Gorcester 202bf69c2f Fixed #22095 -- Enabled backward migrations for RunPython operations
Added reversible property to RunPython so that migrations will not
refuse to reverse migrations including RunPython operations, so long as
reverse_code is set in the RunPython constructor. Included tests to
check the reversible property on RunPython and the similar RunSQL.
2014-02-23 09:30:02 +01:00
Claude Paroz 45edb9d235 Fixed #22057 -- Ensured reverse_lazy can be used in settings
And without causing a circular import. Thanks Akis Kesoglou for
the report.
2014-02-18 10:23:30 +01:00
Ben Davis df2652c448 Fixed #22073 - Ensure CreateTable operation handles backwards migration correctly when M2M fields are present 2014-02-17 16:51:40 -06:00
Artur Frysiak faf6a911ad Fixed #22023 -- Raised an error for values() followed by defer() or only().
Previously, doing so resulted in invalid data or crash.

Thanks jtiai for the report and Karol Jochelson,
Jakub Nowak, Loic Bistuer, and Baptiste Mispelon for reviews.
2014-02-17 14:46:13 -05:00
Andrew Godwin 3c547a423f Merge pull request #2270 from bmispelon/ticket-22030
Fixed #22030 -- Don't assume that all fields have a swappable_setting at...
2014-02-17 01:16:49 +00:00
Christopher Medrela d0133504e5 Fixed #22047 -- detecting related_name clash with inheritance
Thanks to mondone for fruitful colaboration.
2014-02-15 17:24:05 +01:00
Albert Wang 8bbdcc76e4 Fixed #19299 -- Fixed Nullification of Foreign Keys To CharFields
Thanks tunixman for the report and Baptiste Mispelon and
Shai Berger for reviews.
2014-02-15 09:47:32 -05:00
Rodolfo Carvalho be6d1f39e8 Fixed typo in docstring. 2014-02-15 13:35:41 +01:00
Anton Baklanov 0bd92d68ad Fixed #22035 -- reordered migration operations
Now AddField actions appear in operations list before AlterUniqueTogether
actions.

Thanks to SmileyChris for the report.
2014-02-14 20:00:39 -05:00
Baptiste Mispelon 6873eeeefb Fixed #22030 -- Don't assume that all fields have a swappable_setting attribute. 2014-02-13 17:43:21 +01:00
Andrew Godwin bad9456b9c Fix my slightly hasty autodetector changes 2014-02-12 17:22:50 +00:00
Andrew Godwin 80bbe2265d Remove redunant code from RunPython operation 2014-02-12 17:21:25 +00:00
Christopher Adams eefc88feef Fixed #2445 -- Allowed limit_choices_to attribute to be a callable.
ForeignKey or ManyToManyField attribute ``limit_choices_to`` can now
be a callable that returns either a ``Q`` object or a dict.

Thanks michael at actrix.gen.nz for the original suggestion.
2014-02-11 14:05:12 -05:00
Christopher Medrela ee9fcb1672 Fixed #17673 -- Forbid field shadowing.
Thanks Anssi Kääriäinen for the suggestion.
2014-02-10 10:04:19 -05:00
Robert Stapenhurst 12385a5f86 Fixed #21763 -- Added an error msg for missing methods on ManyRelatedManager.
Attempting to add() and remove() an object related by a 'through' model
now raises more descriptive AttributeErrors, in line with set and
create().
2014-02-09 16:01:17 -05:00
Marc Tamlyn d238ab2991 Silence deprecation warnings.
Also they should only be raised if allow_syncdb does exist, not just if
allow_migrate does not.

Refs comments on 250841017c
2014-02-09 17:48:15 +00:00
Andrew Godwin 935e6c1dfc Fixed #21868: Don't die when seeing py3 namespace packages for mig dirs 2014-02-09 14:03:41 +00:00
Andrew Godwin 11c021336c Fixed #21958: Handle dependencies for swappable models in AddField 2014-02-09 12:46:38 +00:00
Andrew Godwin 42607a9e33 Fixed #21844: Move quote_parameter off of Operations and rename 2014-02-09 12:42:26 +00:00
Andrew Godwin 9c4ad454d1 Fixed #21842: Remove redundant DatabaseFeatures.max_index_name_length 2014-02-09 12:33:52 +00:00
Marc Tamlyn 250841017c Raise (pending) deprecation warning for allow_syncdb. 2014-02-09 11:42:34 +00:00
Andrew Godwin 2085f53f56 Fixed #21968: Bad detection of old-style apps to add initial migration 2014-02-09 11:42:10 +00:00
Andrew Godwin 97a8fd4682 Fixed #21954: Raise nice error when serializing datetimes with timezones 2014-02-09 11:17:38 +00:00
Tim Graham 4f8e8a6ec2 Removed unused imports + other flake8 fixes. 2014-02-09 06:13:10 -05:00