Commit Graph

11018 Commits

Author SHA1 Message Date
Claude Paroz 96e4b52ab2 Converted Django scripts to argparse
Refs #19973.
2014-06-09 10:13:37 +02:00
Andrew Godwin 8c12d51ea2 Fixed #22487: Optional rollback emulation for migrated apps 2014-06-08 19:30:15 -07:00
Andrew Godwin 3f91238adf Fixed #22777: Add dependency on through for autodetected M2M adds 2014-06-08 17:12:59 -07:00
Aymeric Augustin 6e5651e514 Gave unique names to SpatialRefSysModels.
Prevented clashes in the app registry.

Fixed #22790. Thanks timo for the report.
2014-06-08 21:15:47 +02:00
Alex Gaynor d8f6b55aa8 Optimize is_protected_type slightly (used by force_text, which is used basically everywhere) 2014-06-07 20:36:59 -07:00
Andrew Godwin 4ce7a6bc84 Fixed #22750, #22248: Model renaming now also alters field FKs 2014-06-07 18:18:02 -07:00
Tim Graham 1e84d261d6 Removed usage of deprecated django.utils.importlib. 2014-06-07 21:10:44 -04:00
Víðir Valberg Guðmundsson f70f669941 Fixed #22749: Making SQL management commands migration aware. 2014-06-07 17:18:30 -07:00
Andrew Godwin 6fd455adfc Fixed #22436: More careful checking on method ref'ce serialization 2014-06-07 17:05:51 -07:00
Tim Graham 250e2b422b Silenced some GIS deprecation warnings; refs #22384. 2014-06-07 19:35:57 -04:00
Aymeric Augustin 5836a5771f Fixed #20815 -- Don't enforce unbuffered I/O on Python 3.
No test because this code is already deprecated (part of FastCGI support).
2014-06-07 22:33:56 +02:00
Aymeric Augustin d7f1f316bc Simplified module_has_submodule on Python >= 3.3.
Stopped using the imp module on Python >= 3.3. Refs #21628.
2014-06-07 22:02:05 +02:00
Aymeric Augustin 47a9347b98 Fixed #6992 -- Improved error when middleware omits HttpResponse.
Thanks guettli for the report.
2014-06-07 19:48:45 +02:00
Aymeric Augustin 58de495c54 Fixed #17427 -- Removed dubious definition of connections equality. 2014-06-07 17:04:10 +02:00
Aymeric Augustin d98cc41a84 Made a test compatible with Python 2 and 3. 2014-06-07 15:04:06 +02:00
Unai Zalakain 11284a63d4 Fixed #18314 -- Corrected request.build_absolute_uri() handling of paths starting with //
``HttpRequest.build_absolute_uri()`` now correctly handles paths starting with ``//``.
``WSGIRequest`` now doesn't remove all the leading slashes either,
because ``http://test/server`` and http://test//server`` aren't the same thing
(RFC2396).

Thanks to SmileyChris for the initial patch.
2014-06-07 08:59:02 -04:00
Aymeric Augustin cfcca7ccce Fixed #3711, #6734, #12581 -- Bounded connection.queries.
Prevented unlimited memory consumption when running background tasks
with DEBUG=True.

Thanks Rob, Alex, Baptiste, and others.
2014-06-07 14:37:43 +02:00
Simon Charette e2112edd9a Fixed #22772 -- Defer wizard temporary files deletion. 2014-06-06 23:41:15 -04:00
Tim Graham b5a54168f9 Fixed flake8 errors. 2014-06-06 08:29:27 -04:00
Aymeric Augustin 1181b8a4a9 Merge pull request #2764 from gchp/ticket-20550
Fixed #20550 -- Added keepdb argument to destroy_test_db
2014-06-06 14:05:41 +02:00
Claude Paroz daaeb84158 Fixed #22773 -- Forced templatize() to return unicode 2014-06-06 08:42:52 +02:00
Andrew Godwin 1fe941adb0 Prevent operation pollution by later operations of fields 2014-06-05 23:34:13 -07:00
Andrew Godwin aa12ea05ce Rewrote migration autodetector to involve actual computer science.
Fixes #22605, #22735; also lays the ground for some other fixes.
2014-06-05 23:25:35 -07:00
Andrew Godwin 5826dc5282 Merge pull request #2736 from SmileyChris/migration-run_before
Fixed #22725 - Migration.run_before does nothing
2014-06-05 20:29:26 -07:00
Aymeric Augustin e071f67b7f Replaced an explicit vendor check by a feature flag.
Forward-port of c9aedce0 from stable/1.7.x.
2014-06-06 00:32:13 +02:00
Greg Chapple 72f055e535 Fixed #20550 -- Added keepdb argument to destroy_test_db 2014-06-05 23:17:27 +01:00
Susan Tan 484f3edf1e Fixed #18400 -- Modified length template filter to return 0 for unknown variables.
Thanks Florian for the bug report, luyikei for the initial code patch, and
Bouke for the code review feedback.
2014-06-05 15:41:56 -04:00
Anubhav Joshi 5643a3b51b Fixed #10811 -- Made assigning unsaved objects to FK, O2O, and GFK raise ValueError.
This prevents silent data loss.

Thanks Aymeric Augustin for the initial patch and Loic Bistuer for the review.
2014-06-05 13:12:01 -04:00
Moayad Mardini 4f72e5f03a Fixed #21773 -- made daemon threads default in the development server.
Thanks clime for the report.
2014-06-05 12:26:24 -04:00
Konstantin Koroviev e560558ecb Fixed #22746 -- Removed background property from pre/code in admin CSS. 2014-06-05 12:03:17 -04:00
Aymeric Augustin a03d38ddd4 Added a flag for the ability to introspect nullable fields.
Previously this was conflated with another Oracle-specific behavior.
2014-06-05 17:56:56 +02:00
Anubhav Joshi 45e049937d Fixed #13776 -- Fixed ModelForm.is_valid() exception with non-nullable FK and blank=True.
Thanks peterbe for the report.
2014-06-04 07:57:19 -04:00
gyx1000 7e2c87809c Fixed #22684 -- Amended SelectDateWidget.empty_label to accept a tuple of values.
Thanks danielsamuels for the report
2014-06-04 07:23:25 -04:00
Claude Paroz fb9d8f0652 Fixed #22717 -- Auto-corrected missing ending slash in FileSystemStorage
Thanks David Fischer for the report and Moayad Mardini for the
review.
2014-06-04 08:53:17 +02:00
Alexandr Shurigin 083d285b82 Fixed #22681 -- Made TarArchive recognize leading directories properly. 2014-06-03 12:00:33 -04:00
Egor Semiguzov c5226eb72a Removed erroneous trailing comma in OLMapWidget.js. 2014-06-03 07:44:06 -04:00
Tim Graham 4445d36d47 Fixed #22384 -- Deprecated reversing URLs by dotted path. 2014-06-03 07:30:14 -04:00
Nick Presta 11f0899bbe Fixed #11776 -- Added CSS class for non-field/top of form errors.
Thanks Daniel Pope for the suggestion.
2014-06-02 15:22:15 -04:00
Craig de Stigter ce993efda8 Fixed #22690 -- Added a check for proxy models containing fields.
Removed the FieldError raised by ModelBase.__new__ in this case.
2014-06-02 09:32:38 -04:00
Tim Graham 5046c110cf Revert "Fixed #19303 -- Fixed ModelAdmin.formfield_overrides on fields with choices"
This reverts commit 9d1987d767.
2014-06-02 07:05:38 -04:00
Claude Paroz 5a504a5311 Fixed #22744 -- Fixed sqlite3 get_relations introspection with views
Thanks Tim Graham for the report and Simon Charette for the review.
2014-06-01 22:03:33 +02:00
Vincent-Vega d04e730224 Fixed #22711 -- Adjusted ordering checks to allow implicit relation fields.
refs #19195.
2014-06-01 15:36:25 -04:00
Simon Charette 7a38f88922 Fixed #22659 -- Prevent model states from sharing field instances.
Thanks to Trac alias tbartelmess for the report and the test project.
2014-06-01 15:10:38 -04:00
Fabio Rueda f384b638e2 Fixed syntax error in ogrinspect.py management command. 2014-06-01 13:19:42 -04:00
Aymeric Augustin 2a5c750ad1 Merge pull request #2726 from gchp/ticket-20550
Fixed #20550 -- Added ability to preserve test db between runs
2014-06-01 17:26:56 +02:00
Florian Apolloner 83e7555ffe Revert "Making SQL management commands migration aware."
This reverts commit cb9c9a7b58.
2014-06-01 12:00:09 +02:00
Alex Gaynor 875ce287e2 Note that the stdlib's version of pbkdf2_hmac will also be used in the upcoming Python 2.7.8 release 2014-05-31 13:50:07 -07:00
Florian Apolloner c4c2c99669 Fixed #19905 -- Fixed leakage of file descriptors in form wizard. 2014-05-30 21:58:42 +02:00
Andrew Godwin 347cab4fae Merge pull request #2744 from mmardini/MIGRATION_MODULES
Fixed #22682 -- `makemigrations` will create `MIGRATION_MODULES` package
2014-05-29 15:38:21 -07:00
Andrew Godwin 67d9f70e4c Fix test failure caused by 3149cdce32 2014-05-29 15:34:35 -07:00
Moayad Mardini 56cfa508c7 Fixed #22682 -- `makemigrations` will create `MIGRATION_MODULES` package
`makemigrations` will automatically create the package specified
in `MIGRATION_MODULES` if it doesn't already exist.

Thanks ovidiuc4 for the report.
2014-05-30 01:23:09 +03:00
Víðir Valberg Guðmundsson cb9c9a7b58 Making SQL management commands migration aware. 2014-05-29 23:03:10 +02:00
Antonis Christofides 62f9508ade Fixed #20401 -- ContentTypeManager.get_for_model reads from db_for_read.
Thanks Simon Charette and Tim Graham for the reviews.
2014-05-29 23:01:55 +07:00
Chris Beaven 45fa520187 Implement Migration.run_before
This attribute (used for reverse dependencies) was previously declared
and mentioned in the code, but never actually used.
2014-05-29 22:42:11 +12:00
Alex Gaynor 1dcc603eff Fixed several typos in Django 2014-05-28 17:39:14 -07:00
Alex Gaynor e79725cdf9 Simplified, very slightly, some code in the oracle backend 2014-05-28 17:17:58 -07:00
Andrew Godwin 61185bba72 Merge pull request #2734 from valberg/double_order_trouble
Fixed #22720 -- Migrations attempt to create _order twice.
2014-05-28 17:12:01 -07:00
Víðir Valberg Guðmundsson 6cfa2fae39 Fixed #22720 -- Migrations attempt to create _order twice. 2014-05-29 01:00:30 +02:00
Shai Berger 69337d485c Set straight the sense of 'uppercases_column_names' feature flag 2014-05-28 21:16:24 +03:00
Florian Apolloner 7e3cf3cfd2 Fixed constant_time_compare on Python 2.7.7
Python 2.7.7 includes compare_digest in the hmac module, but it requires
both arguments to have the same type. This is usually not a problem on
Python 3 since everything is text, but we have mixed unicode and str on
Python 2 -- hence make sure everything is bytes before feeding it into
compare_digest.
2014-05-28 19:51:39 +02:00
Guillaume Pannatier 32586b0ba4 Fixed #22684 -- Added `empty_label` option on `django.forms.extras.widets.SelectDateWidget`
Thanks danielsamuels for the report
2014-05-28 13:23:28 -04:00
Shai Berger fd427f1fe3 Fixed #22715: Corrected sql for defaults of BinaryField on Oracle with Python3
While at it, fixed a problem in returning empty values
(still with BinaryField/Oracle/Python3).
2014-05-28 18:57:40 +03:00
Greg Chapple b7aa7c4ab4 Fixed #20550 -- Added ability to preserve test db between runs 2014-05-28 16:22:46 +01:00
Claude Paroz e97b7a2677 Fixed #22714 -- Made contrib.gis use six-provided memoryview type
Thanks Tim Graham for the report.
2014-05-28 09:24:08 +02:00
Simon Charette d0f7c7f59a Argument to `reversed` must be a sequence on Py3. 2014-05-27 18:28:13 -04:00
Simon Charette fed2877cf1 Fix a regression introduced by f011b90363.
`django.get_version` was actually used by the module.
2014-05-27 18:23:44 -04:00
Claude Paroz f011b90363 Removed an old compatibility shim added in 1.0 2014-05-27 22:28:49 +02:00
Claude Paroz fe53bc524b Fixed #21630 -- Simplified management command discovery
Thanks Aymeric Augustin for the report end the review.
2014-05-27 22:18:51 +02:00
Aymeric Augustin 4865326f22 Fixed #22699 -- Configure default settings in some management commands.
This makes it possible to run django.setup() in management commands that
don't need a settings module. In addition it simplifies error handling.

Thanks Claude for the review.
2014-05-27 21:43:52 +02:00
Moayad Mardini 2e613ea5c5 Fixed #22675 -- makemigrations --dry-run to output migrations to stdout.
`makemigrations --dry-run` will output the complete migrations file
that would be written if it's used along with `--verbosity 3`.
2014-05-27 00:40:55 +03:00
Florian Apolloner 9d1bf8f841 Removed executeable bit from a few files. 2014-05-25 23:16:40 +02:00
Loic Bistuer b7de5f5d3f Fixed a few ResourceWarning in the test suite. Refs #22680. 2014-05-26 03:23:17 +07:00
Claude Paroz 2779c299c8 Removed code deprecated from Django 1.2 2014-05-25 21:25:23 +02:00
Claude Paroz c5d73b687d Removed comment forgotten in 3caf957ed5 2014-05-24 16:22:08 +02:00
Claude Paroz 3caf957ed5 Removed GeoWhereNode, obsoleted by GISLookup 2014-05-24 16:18:45 +02:00
Moayad Mardini 63fc91b3ca Fixed #22676 -- makemigrations --dry-run should not ask for defaults
Made the fix in InteractiveMigrationQuestioner class code, rather than
MigrationAutodetector, because --dry-run shouldn't affect whether
MigrationAutodetector will detect non-nullable fields, but the
questioner should skip the question and returns a None for default
(since that won't be used anyway) if --dry-run is used.
2014-05-24 09:56:18 -04:00
Marc Tamlyn 9fb0f5dddc Fixed #22510 -- Harden field removal to only None.
Refs #8620.

If we allow any value to remove form fields then we get name clashes
with method names, media classes etc. There was a backwards
incompatibility introduced meaning ModelForm subclasses with declared
fields called media or clean would lose those fields.

Field removal is now only permitted by using the sentinel value None.
The docs have been slightly reworded to refer to removal of fields
rather than shadowing.

Thanks to gcbirzan for the report and initial patch, and several of the
core team for opinions.
2014-05-24 13:10:50 +01:00
Claude Paroz dbb48d2bb9 Applied unicode_literals to makemessages command
This also fixes #22686 as some sort of side-effect.
2014-05-24 11:51:57 +02:00
Preston Timmons be88b062af Fixed #21357 -- Fixed test client session initialization.
The test client will now create a session when it is first accessed
if no session already exists.
2014-05-22 20:29:48 -04:00
Unai Zalakain 4dc4d12e27 Fixed #21598 -- cleaned up template loader overrides in tests
- Template loader overriding is managed with contexts.
- The test loader is a class (function based loaders entered deprecation timeline
  in 1.4).
- Template loader overrider that overrides with test loader added.
2014-05-22 18:35:16 -04:00
Moayad Mardini ad994a3c5b Fixed #22679 -- Fixed empty tuple serialization in MigrationWriter.
Thanks rockallite.wulf for the report.
2014-05-22 16:15:09 +02:00
Marc Tamlyn 3545f31bcf Merge pull request #2699 from graingert/patch-3
the SECRET_KEY is not a hash
2014-05-22 13:32:03 +01:00
Marc Tamlyn 6ab67919ac Made nested deconstruction support both forms of deconstruct()
Nested deconstruction should (silently) handle Field.deconstruct() as
well as other arbitrary deconstructable objects. This allows having a
field in the deconstruction of another field.
2014-05-22 13:23:51 +01:00
Thomas Grainger 46082339d2 the SECRET_KEY is not a hash 2014-05-22 11:19:54 +01:00
Marc Tamlyn 604162604b Added array field support for PostgreSQL.
The first part of django.contrib.postgres, including model and two form
fields for arrays of other data types.

This commit is formed of the following work:

    Add shell of postgres app and test handling.

    First draft of array fields.

    Use recursive deconstruction.

    Stop creating classes at lookup time.

    Add validation and size parameter.

    Add contained_by lookup.

    Add SimpleArrayField for forms.

    Add SplitArrayField (mainly for admin).

    Fix prepare_value for SimpleArrayField.

    Stop using MultiValueField and MultiWidget.

    They don't play nice with flexible sizes.

    Add basics of admin integration.

    Missing:
    - Tests
    - Fully working js

    Add reference document for django.contrib.postgres.fields.ArrayField.

    Various performance and style tweaks.

    Fix internal docs link, formalise code snippets.

    Remove the admin code for now.

    It needs a better way of handing JS widgets in the admin as a whole
    before it is easy to write. In particular there are serious issues
    involving DateTimePicker when used in an array.

    Add a test for nested array fields with different delimiters.

    This will be a documented pattern so having a test for it is useful.

    Add docs for SimpleArrayField.

    Add docs for SplitArrayField.

    Remove admin related code for now.

    definition -> description

    Fix typo.

    Py3 errors.

    Avoid using regexes where they're not needed.

    Allow passing tuples by the programmer.

    Add some more tests for multidimensional arrays.

    Also fix slicing as much as it can be fixed.

    Simplify SplitArrayWidget's data loading.

    If we aren't including the variable size one, we don't need to search
    like this.
2014-05-22 09:53:26 +01:00
Ramiro Morales fce6a29428 Merge pull request #2498 from ramiro/move-serverhandler
Moved ServerHandler helper class to tests.
2014-05-21 18:59:01 -03:00
Ramiro Morales d731f48ece Merge pull request #2679 from ramiro/t22421
Fixed #22421 -- Regression in fixtures loading.
2014-05-21 18:57:46 -03:00
Martin Brochhaus bb0a9a070b Fixed #20477: Allowed list of modules for FORMAT_MODULE_PATH
Previously the FORMAT_MODULE_PATH setting only accepted one string (dotted
module path). A feature has been added to also allow a list of strings.

This is useful when using several reusable third party apps that define new
formats. We can now use them all and we can even override some of the formats
by providing a project-wide format module.
2014-05-21 07:35:47 -04:00
Loic Bistuer 27a3cfcd77 Fixed unused import. 2014-05-21 10:42:07 +07:00
Loic Bistuer 870b0a1f86 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.
2014-05-21 10:30:48 +07:00
Loic Bistuer bdf3473e64 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.
2014-05-21 10:26:04 +07:00
Denis Cornehl 3bec38888f Fixed #22557 -- ManifestStaticFilesStorage did not cleanup deleted files.
When using ManifestStaticFilesStorage, deleted static files would be
correctly cleaned up by "collectstatic --clear", but the manifest file
would still contain the stale entries.

Thanks to tedtieken for the report
2014-05-20 18:14:49 +02:00
Andrew Godwin 12c72796c3 Revert "Fixed #22645: Allow apps with no models module to still have migrations"
This reverts commit a4737bf6ae.
2014-05-20 16:53:21 +01:00
Andrew Godwin 03900a02d5 Fixed #22432: SQLite M2M repointing now works. Thanks to xelnor. 2014-05-20 16:25:59 +01:00
Andrew Godwin 125b3d4407 Fixed #22649: Beefed up quote_value 2014-05-20 15:41:01 +01:00
Andrew Godwin 4e32e47348 Merge pull request #2634 from loic/ticket22424
Fixed #22424 -- MySQL doesn't accept migrations' one-off default values ...
2014-05-20 14:25:59 +01:00
Andrew Godwin 1b07781292 Add feature for implied null (needed for Firebird backend) 2014-05-20 13:27:07 +01:00
Andrew Godwin a4737bf6ae Fixed #22645: Allow apps with no models module to still have migrations 2014-05-20 13:19:17 +01:00
Claude Paroz b8c480a12b Removed unused translations in auth tests 2014-05-20 12:21:05 +02:00
Erik Romijn ba5ddf7aed Fixed #22638 -- Changed CookieWizardView to ignore invalid cookies 2014-05-19 19:16:45 +02:00