1
0
mirror of https://github.com/django/django.git synced 2025-04-11 11:02:22 +00:00

1776 Commits

Author SHA1 Message Date
Andrew Godwin
b1e0ec06f0 Merge branch 'master' into schema-alteration 2013-07-02 10:49:53 +01:00
Aymeric Augustin
d5589b4cd3 Removed some conditional code only needed under Python 2.6. 2013-07-01 12:02:17 +02:00
Alex Gaynor
b9ebca6a28 Removed a comment that wasn't adding a value.
In the intervening years, RelatedField has become less of a hack (though it still is one). Anyone who wants to can re-instate the comment, but please add more details.
2013-06-30 23:32:23 -07:00
Aymeric Augustin
dd9c6bc359 Introduced getters for connection.autocommit and .needs_rollback.
They ensure that the attributes aren't accessed in conditions where they
don't contain a valid value.

Fixed #20666.
2013-06-30 15:57:00 +02:00
Aymeric Augustin
acd7b34aaf Advanced deprecation warnings for Django 1.7. 2013-06-29 18:49:37 +02:00
Claude Paroz
59b0c48ce2 Fixed #18592 -- Prevented crash when accessing MySQL _last_executed
Thanks reames at asymmetricventures.com for the report.
2013-06-29 18:44:41 +02:00
Claude Paroz
ea3fe78a9d Fixed #20660 -- Do not try to delete an unset FieldFile
Thanks stanislas.guerra at gmail.com for the report and
Baptiste Mispelon for the review.
2013-06-29 18:08:39 +02:00
Ramiro Morales
6ba69c8456 Removed 'depth' .select_related() argument as per deprecation TL. 2013-06-28 21:48:16 -03:00
Andrew Godwin
904b82759c Fix Python 3 support 2013-06-28 17:53:49 +01:00
Andrew Godwin
7a47ba6f6a Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/backends/__init__.py
	django/db/models/fields/related.py
	tests/field_deconstruction/tests.py
2013-06-28 17:32:57 +01:00
Andrew Godwin
48dd1e63bb Ported over Field.deconstruct() from my schema alteration branch.
This is to help other ongoing branches which would benefit from
this functionality.
2013-06-28 17:27:52 +01:00
Shai Berger
d097417025 Support 'pyformat' style parameters in raw queries, Refs #10070
Add support for Oracle, fix an issue with the repr of RawQuerySet,
add tests and documentations. Also added a 'supports_paramstyle_pyformat'
database feature, True by default, False for SQLite.

Thanks Donald Stufft for review of documentation.
2013-06-28 06:59:10 +03:00
Aymeric Augustin
c1284c3d3c Fixed #20571 -- Added an API to control connection.needs_rollback.
This is useful:
- to force a rollback on the exit of an atomic block without having to
  raise and catch an exception;
- to prevent a rollback after handling an exception manually.
2013-06-27 22:19:54 +02:00
Andrew Godwin
99b467f272 Add related_query_name to ForeignKey/M2M. Refs #20244 2013-06-27 14:44:21 +01:00
Loic Bistuer
a9ea7d8c70 Fixed #20462 - Replaced the str() cast introduced in 273dc55 by force_text() 2013-06-26 21:30:58 +07:00
Andrew Clark
273dc550a4 Fixed #20462 -- null/non-string regex lookups are now consistent
Thanks to noirbizarre for the report and initial patch.
2013-06-26 08:13:26 -04:00
Simon Charette
b91787910c Fixed #20642 -- Deprecated Option.get_(add|change|delete)_permission.
Those methods were only used by `contrib.admin` internally and exclusively
related to `contrib.auth`. Since they were undocumented but used
in the wild the raised deprecation warning point to an also undocumented
alternative that lives in `contrib.auth`.

Also did some PEP8 and other cleanups in the affected modules.
2013-06-25 12:22:37 -04:00
Andrew Godwin
e2d7e83256 Autodetect ForeignKeys and add dependencies/split on circulars 2013-06-22 17:15:51 +01:00
Gilberto Gonçalves
680b512fc1 Fixed #20587 -- Made convert_values handle None values 2013-06-22 14:05:12 +01:00
Andrew Godwin
48493cff73 Remove EmailField max_length default removal in deconstruct() 2013-06-22 12:56:37 +01:00
Andrew Godwin
cca40703df Prompt about renames rather than doing them automatically 2013-06-21 15:32:15 +01:00
Andrew Godwin
92a10f5552 Autodetect field renames. HAHAHA. AHAHAHAHA. YES. 2013-06-20 16:02:43 +01:00
Andrew Godwin
47e4b86ddf Autodetect field alters 2013-06-20 15:19:30 +01:00
Andrew Godwin
80bdf68d6b Add AlterField and RenameField operations 2013-06-20 15:12:59 +01:00
Andrew Godwin
6f667999e1 Add operation that renames tables 2013-06-20 14:54:11 +01:00
Andrew Godwin
73e30e9d3b Better naming, and prompt for NOT NULL field addition 2013-06-19 17:01:48 +01:00
Andrew Godwin
41214eaf18 Autodetect fields, have migrate actually work 2013-06-19 16:41:04 +01:00
Andrew Godwin
f25a385a5e Makemigration command now works 2013-06-19 16:23:52 +01:00
Aymeric Augustin
ffcf24c9ce Removed several unused imports. 2013-06-19 17:18:40 +02:00
Andrew Godwin
ab5cbae9b7 First stab at some migration creation commands 2013-06-19 15:36:22 +01:00
Andrew Godwin
2ae8a8a77d Fix test running with new apps stuff/migrate actually running migrations 2013-06-19 15:36:02 +01:00
Andrew Godwin
9daf81b94e Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/models/loading.py
2013-06-19 12:05:23 +01:00
Florian Hahn
2f35c6f10f Fixed #14930 -- values_list() failure on qs ordered by extra column
Thanks lsaffre for the report and simon29, vicould, and Florian Hahn
for the patch.

Some changes done by committer.
2013-06-18 23:56:51 +03:00
Loic Bistuer
ee77d4b253 Fixed #20199 -- Allow ModelForm fields to override error_messages from model fields 2013-06-18 08:01:17 -04:00
Loic Bistuer
f34cfec0fa Refactored ValidationError to allow persisting error params and error codes as the exception bubbles up 2013-06-18 08:01:17 -04:00
Anssi Kääriäinen
aa22cbd51a Fixed #20583 -- ORM always uses setup_joins() for join generation
There were a couple of places which used Query.join() directly. By
using setup_joins() in these places the code is more DRY, and in
addition there is no need to directly call field.get_joining_columns()
unless the field is the given join_field from get_path_info(). This
makes it easier to make sure a ForeignObject subclass generates joins
correctly in all cases.
2013-06-16 15:44:52 +03:00
Anssi Kääriäinen
5459795ef2 Fixed #20289 -- pickling of dynamic models 2013-06-14 17:05:54 +03:00
Anssi Kääriäinen
89bf7a4525 Fixed #20528 -- regression in select_related join promotion
The join used by select_related was incorrectly INNER when the query
had an ORed filter for nullable join that was trimmed away. Fixed this
by forcing the join type to LOUTER even when a join was trimmed away
in ORed queries.
2013-06-14 16:29:06 +03:00
Baptiste Mispelon
dc9c359546 Fixed #20594 -- Add validation to models.SlugField.
Thanks carbonXT for the report.
2013-06-13 13:31:57 -04:00
Tim Graham
92c49d6f01 Revert "Fixed #20462 - Fixed sqlite regex lookups for null values and non-string fields."
This reverts commit 64041f0e6e7a773574d7cde978d16305200004ea.

lookup.tests.LookupTests.test_regex_non_string fails under Postgres.
We should also try to rewrite the test using an existing model.
2013-06-11 17:55:19 -04:00
Axel Haustant
64041f0e6e Fixed #20462 - Fixed sqlite regex lookups for null values and non-string fields. 2013-06-11 14:13:40 -04:00
Aymeric Augustin
4daf570b98 Added TransactionTestCase.available_apps.
This can be used to make Django's test suite significantly faster by
reducing the number of models for which content types and permissions
must be created and tables must be flushed in each non-transactional
test.

It's documented for Django contributors and committers but it's branded
as a private API to preserve our freedom to change it in the future.

Most of the credit goes to Anssi. He got the idea and did the research.

Fixed #20483.
2013-06-10 11:24:10 +02:00
Aymeric Augustin
13b7f299de Added a stealth option to flush to allow cascades.
This allows using flush on a subset of the tables without having to
manually cascade to all tables with foreign keys to the tables being
truncated, when they're known to be empty.

On databases where truncate is implemented with DELETE FROM, this
doesn't make a difference. The cascade is allowed, not mandatory.
2013-06-10 11:21:54 +02:00
Aymeric Augustin
79ff1aedd5 Replaced a dict emulating a set with a set. 2013-06-09 14:31:04 +02:00
Andrew Godwin
315ab41e41 Initial stab at a migrate command, it's probably quite a way off. 2013-06-07 18:47:17 +01:00
Andrew Godwin
91c470def5 Auto-naming for migrations and some writer fixes 2013-06-07 17:56:43 +01:00
Andrew Godwin
cd809619a2 Autodetector tests 2013-06-07 15:49:48 +01:00
Andrew Godwin
c7aa4b5338 Field encoding 2013-06-07 15:36:31 +01:00
Andrew Godwin
4492f06408 A bit of an autodetector and a bit of a writer 2013-06-07 15:28:38 +01:00
Andrew Godwin
3c296382b8 Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/models/fields/related.py
2013-06-07 11:15:34 +01:00