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
Andrew Godwin
a7e2957110
Fixed #21917 : Overly cautious SQLite3 backend for null fields + defaults
2014-02-09 11:10:21 +00:00
Andrew Godwin
98dd8dd02e
Fixed #21892 : RunPython no longer accepts strings
2014-02-09 10:54:02 +00:00
Berker Peksag
5d263dee30
Fixed #21674 -- Deprecated the import_by_path() function in favor of import_string().
...
Thanks Aymeric Augustin for the suggestion and review.
2014-02-08 11:12:19 -05:00
Loic Bistuer
8847a0c601
Fixed #16192 -- Made unique error messages in ModelForm customizable.
...
Overriding the error messages now works for both unique fields, unique_together
and unique_for_date.
This patch changed the overriding logic to allow customizing NON_FIELD_ERRORS
since previously only fields' errors were customizable.
Refs #20199 .
Thanks leahculver for the suggestion.
2014-02-08 04:59:09 -05:00
Vajrasky Kok
d3cf6cfacf
Fixed #17713 -- Renamed BaseDatabaseFeatures.allows_primary_key_0 to allows_auto_pk_0.
...
MySQL does allow primary key with value 0. It only forbids autoincrement
primary key with value 0.
Thanks Claude Paroz for the report.
2014-02-06 05:16:40 -05:00
Marc Tamlyn
aea9faa146
Fix pep8 violation in migration template.
2014-02-05 14:39:44 +00:00
Anssi Kääriäinen
35cecb1ebd
Fixed #21748 -- join promotion for negated AND conditions
...
Made sure Django treats case .filter(NOT (a AND b)) the same way as
.filter((NOT a OR NOT b)) for join promotion.
2014-02-04 18:48:06 +02:00
Michael Manfre
e1d839237f
Make mysql's CursorWrapper a contextmanager.
2014-02-02 22:43:53 +01:00
Alex Gaynor
5616234d4d
Removed an unused import which snuck in.
2014-02-02 12:14:16 -08:00
Michael Manfre
3ffeb93186
Ensure cursors are closed when no longer needed.
...
This commit touchs various parts of the code base and test framework. Any
found usage of opening a cursor for the sake of initializing a connection
has been replaced with 'ensure_connection()'.
2014-02-02 12:47:21 -05:00
Michael Manfre
0837eacc4e
Made SQLCompiler.execute_sql(result_type) more explicit.
...
Updated SQLUpdateCompiler.execute_sql to match the behavior described in
the docstring; the 'first non-empty query' will now include all queries,
not just the main and first related update.
Added CURSOR and NO_RESULTS result_type constants to make the usages more
self documenting and allow execute_sql to explicitly close the cursor when
it is no longer needed.
2014-02-02 12:47:06 -05:00
Shai Berger
e9d12bae1e
Made Oracle introspect FloatFields correctly
...
Broke InspectDBTestCase.test_field_types in two:
- a test_number_field_types, which now passes on Oracle too
- a test_field_types, for all non-numeric fields, which is still expected to fail
Also made some pep8 fixes in the tests file. Refs #19884
Thanks Tim Graham for review.
2014-01-30 00:41:11 +02:00
Shai Berger
ad975c64fc
Made Oracle introspect boolean fields
...
Fixed failing test schema.tests.SchemaTests.test_add_field_temp_default_boolean
Refs #19884
2014-01-29 18:08:01 +02:00
Anssi Kääriäinen
0ca647357e
Fixed #21883 -- Added six.moves.xrange import
...
When moving code around from sql.where to lookups six.moves.xrange
import was forgotten. The xrange import is needed on Python 3.
2014-01-28 21:08:37 +02:00
Loic Bistuer
3e4dc5ecf2
Fixed #21853 -- Fixed Manager.__module__ to properly return 'django.db.models.manager'.
...
The combination of BaseManager.from_queryset() and RenameMethodsBase results in
Manager.__module__ having the wrong value. This can be an issue when trying to
pickle the Manager class.
2014-01-28 08:17:01 -05:00
Carl Meyer
88a2d39159
Fixed #21874 -- Require Django applications to have a filesystem path.
...
Wherever possible this filesystem path is derived automatically from the app
module's ``__path__`` and ``__file__`` attributes (this avoids any
backwards-compatibility problems).
AppConfig allows specifying an app's filesystem location explicitly, which
overrides all autodetection based on ``__path__`` and ``__file__``. This
permits Django to support any type of module as an app (namespace packages,
fake modules, modules loaded by other hypothetical non-filesystem module
loaders), as long as the app is configured with an explicit filesystem path.
Thanks Aymeric for review and discussion.
2014-01-27 15:34:22 -07:00
Andrew Godwin
6758a9c0fc
Fixed #21872 : Not detecting dependencies from M2M fields
2014-01-27 11:49:55 +00:00
Aymeric Augustin
4f03b718f7
Fixed #21877 -- Renamed django.apps.base to config.
2014-01-26 13:17:03 +01:00
Aymeric Augustin
f901b4d6c8
Took advantage of the new get_model API. Refs #21702 .
2014-01-26 13:08:05 +01:00
Andrew Godwin
f5f556dba3
Unroll choices iterators in field deconstruction
2014-01-25 00:23:28 +00:00
Andrew Godwin
2a30b39f40
Fixed #21783 : More SQLite default fun with nulls.
2014-01-25 00:10:25 +00:00
Andrew Godwin
4b3b25104d
Fix soft-apply detection of migrations with dependencies
2014-01-24 12:26:38 +00:00
Anssi Kääriäinen
78a2617703
Fixed #21787 -- regression in MTI .exclude() queries
2014-01-24 10:10:17 +02:00
Markus Holtermann
047394f79c
Fixed #21852 -- Make migration writer serialize iterators
2014-01-22 09:21:54 +01:00
Russell Keith-Magee
494b408041
Corrected problem with MySQL checks handler and related fields.
2014-01-21 18:37:49 +08:00
Anssi Kääriäinen
1c360dbbf5
Use date_extract_sql() for DateFields
...
Refs #21821
2014-01-20 10:52:58 +02:00
Anssi Kääriäinen
b86321e9a4
Fixed regex lookup on Oracle
...
Refs #21821
2014-01-20 10:52:58 +02:00
Anssi Kääriäinen
a9f1711518
Fixed Oracle in lookup when more than 1000 params
...
Refs #21821 .
2014-01-20 10:52:57 +02:00
Russell Keith-Magee
a029efca44
Removed an inactive system check for upload_to.
...
Thanks to Simon Charette for the eagle eyes.
2014-01-20 12:31:35 +08:00
Alex Gaynor
be8173af51
Fixed a small collection of flake8 violations that had snuck in
2014-01-19 21:15:31 -06:00
Russell Keith-Magee
d818e0c9b2
Fixed #16905 -- Added extensible checks (nee validation) framework
...
This is the result of Christopher Medrela's 2013 Summer of Code project.
Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian
Apolloner, and Alex Gaynor for review notes along the way.
Also: Fixes #8579 , fixes #3055 , fixes #19844 .
2014-01-20 10:45:21 +08:00
Andrew Godwin
6bbb820014
Fixed #21290 : Documented migration serializing and improved error
2014-01-19 19:27:30 +00:00
Andrew Godwin
3f1a008266
Fixed #21664 : Multi-table inheritance was duplicating _ptr fields
2014-01-19 18:35:49 +00:00
Andrew Godwin
1f5268a01f
Fixed #21786 : Bad behaviour when mixins + abstract bases for migrations
2014-01-19 18:09:52 +00:00
Andrew Godwin
af4a8478e4
Fixed #21783 : (again) Found second source of bug, also squashed it.
2014-01-19 17:43:31 +00:00