Commit Graph

8885 Commits

Author SHA1 Message Date
Claude Paroz e4bf0f2c36 Fixed #19942 -- Decoded errors coming from Popen commands
Thanks Aymeric Augustin for reporting the issue.
2013-03-03 20:00:44 +01:00
Pedro Mourelle 0868e5a8ac Fixed #19177 -- Better layout for admin login form field labels.
Thanks goes to void for the comprehensive report, to Pedro Mourelle for
the fix and to Bryan Veloso, Łukasz Rekucki and Claude Paroz for the
review.

This fix includes the following changes:

* Modified layout to top-aligned labels.
* Added 'air' for inputs (the padding was really needed there.). It
  adjust good to zoom in/out.
* Removed float attributes from label and inputs in login form.
* Removed useless text-align property.
2013-03-02 20:27:59 -03:00
Claude Paroz 8e8c9b908a Fixed getting default encoding in get_system_username
Refs #19933.
2013-03-02 22:41:08 +01:00
Claude Paroz 21722702c8 Fixed #16888 -- Added microseconds in localized input formats 2013-03-02 19:04:23 +01:00
Claude Paroz 384c180e41 Fixed #19917 -- Added microseconds in default TIME_INPUT_FORMATS
Thanks minddust for the report.
2013-03-02 18:11:10 +01:00
Aymeric Augustin e0449316eb Fixed #18130 -- Made the isolation level configurable on PostgreSQL.
Thanks limscoder for the report and niwi for the draft patch.
2013-03-02 15:05:49 +01:00
Aymeric Augustin d63e55039d Reordered methods in database wrappers.
* Grouped related methods together -- with banner comments :/
* Described which methods are intended to be implemented in backends.
* Added docstrings.
* Used the same order in all wrappers.
2013-03-02 13:33:17 +01:00
Claude Paroz c5a25c2771 Add introspection support for BinaryField 2013-03-02 10:29:03 +01:00
Claude Paroz d680a3f447 Added support for serializing BinaryField 2013-03-02 10:29:02 +01:00
Claude Paroz 8ee1eddb7e Add a BinaryField model field
Thanks Michael Jung, Charl Botha and Florian Apolloner for review
and help on the patch.
2013-03-02 10:29:02 +01:00
Simon Charette 952ba5237e Added a context manager to capture queries while testing.
Also made some import cleanups while I was there.

Refs #10399.
2013-03-02 02:41:14 -05:00
Aymeric Augustin 203c17c21e Added import forgotten in 2ee21d9.
Thanks ratsonale for spotting this mistake.
2013-03-01 23:46:53 +01:00
matiasb f39fead1c3 Fixed #19945 -- Fixed default User model Meta inheritance.
Updated default User model Meta class to extend AbstractUser Meta
where translated verbose_name and verbose_name_plural are
defined.
2013-03-01 19:32:20 -03:00
Claude Paroz 0657646cb8 Removed unused options copy in flush
This was used at the time the 'database' option did not default to
DEFAULT_DB_ALIAS in make_option.
2013-03-01 22:52:08 +01:00
Claude Paroz 3318595c0b Fixed #18898 -- Added tests with a fix for ModelMultipleChoiceField 2013-03-01 09:35:18 +01:00
Claude Paroz 892bc91cb0 Fixed #16612 -- Improved has_changed detection for localized field values
Thanks Simon Charette for the review.
2013-03-01 09:35:04 +01:00
Aymeric Augustin 0c82b1dfc4 Fixed #19929 -- Improved error when MySQL doesn't have TZ definitions.
Thanks tomas_00 for the report.
2013-02-28 17:35:13 +01:00
Aymeric Augustin cf30469164 Fixed tests broken in 2ee21d9. 2013-02-28 17:08:16 +01:00
Aymeric Augustin 2ee21d9f0d Implemented persistent database connections.
Thanks Anssi Kääriäinen and Karen Tracey for their inputs.
2013-02-28 15:28:13 +01:00
Aymeric Augustin aa089b106b Fixed #5241 -- Kept active transalation in LocaleMiddleware.process_response. 2013-02-28 14:21:48 +01:00
Anssi Kääriäinen 06de130dae Fixed #12823 -- Was already fixed in master, tests added
Also added a little improvement to sql/query.py to get rid of
non-necessary IS NOT NULL check.
2013-02-28 15:05:48 +02:00
Aymeric Augustin 1b100d7bee Fixed two bugs in 59a35208.
* StandardError doesn't exist any more under Python 3.
* Python 2.6 still allows `raise "foo"`.
2013-02-27 19:24:23 +01:00
Aymeric Augustin 59a3520875 Refactored database exceptions wrapping.
Squashed commit of the following:

commit 2181d833ed1a2e422494738dcef311164c4e097e
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 27 14:28:39 2013 +0100

    Fixed #15901 -- Wrapped all PEP-249 exceptions.

commit 5476a5d93c19aa2f928c497d39ce6e33f52694e2
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Feb 26 17:26:52 2013 +0100

    Added PEP 3134 exception chaining.

    Thanks Jacob Kaplan-Moss for the suggestion.

commit 9365fad0a650328002fb424457d675a273c95802
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Feb 26 17:13:49 2013 +0100

    Improved API for wrapping database errors.

    Thanks Alex Gaynor for the proposal.

commit 1b463b765f2826f73a8d9266795cd5da4f8d5e9e
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Feb 26 15:00:39 2013 +0100

    Removed redundant exception wrapping.

    This is now taken care of by the cursor wrapper.

commit 524bc7345a724bf526bdd2dd1bcf5ede67d6bb5c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Feb 26 14:55:10 2013 +0100

    Wrapped database exceptions in the base backend.

    This covers the most common PEP-249 APIs:
    - Connection APIs: close(), commit(), rollback(), cursor()
    - Cursor APIs: callproc(), close(), execute(), executemany(),
      fetchone(), fetchmany(), fetchall(), nextset().

    Fixed #19920.

commit a66746bb5f0839f35543222787fce3b6a0d0a3ea
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Feb 26 14:53:34 2013 +0100

    Added a wrap_database_exception context manager and decorator.

    It re-throws backend-specific exceptions using Django's common wrappers.
2013-02-27 17:26:54 +01:00
Anssi Kääriäinen 50328f0a61 Fixed #19861 -- Transaction ._dirty flag improvement
There were a couple of errors in ._dirty flag handling:
  * It started as None, but was never reset to None.
  * The _dirty flag was sometimes used to indicate if the connection
    was inside transaction management, but this was not done
    consistently. This also meant the flag had three separate values.
  * The None value had a special meaning, causing for example inability
    to commit() on new connection unless enter/leave tx management was
    done.
  * The _dirty was tracking "connection in transaction" state, but only
    in managed transactions.
  * Some tests never reset the transaction state of the used connection.
  * And some additional less important changes.

This commit has some potential for regressions, but as the above list
shows, the current situation isn't perfect either.
2013-02-27 17:54:27 +02:00
Łukasz Langa 40b9f4fb8b [py3] Always fed hashlib with bytes. 2013-02-27 10:02:07 +01:00
Ramiro Morales 8459eac031 Move management helper function to new utils module.
This allows us to iremove an inter-command import.
2013-02-26 22:07:22 -03:00
Ramiro Morales dfa9324966 Don't use os.system() in compilemessages.
Fixes #19584.

This implies stop storing file path command line arguments in envvars as
a security measure to start relying on with Popen's shell=False instead,
and addition of an 'utils' module.

Thanks kmichel_wgs for the report.
2013-02-26 21:31:53 -03:00
Claude Paroz 87cc3da814 Merged contrib translations from 1.5 branch 2013-02-26 21:51:06 +01:00
Claude Paroz 6ca475d540 Merged core translations from 1.5 branch 2013-02-26 21:51:06 +01:00
Łukasz Langa 6a057e1595 Fixed #18191 -- Don't consider Accept-Language redundantly in cache key.
Thanks to choongmin for the original patch.
2013-02-25 16:10:57 -07:00
Aymeric Augustin e76147a83a Fixed #19634 -- Added proper __hash__ methods.
Classes overriding __eq__ need a __hash__ such that equal objects have
the same hash.

Thanks akaariai for the report and regebro for the patch.
2013-02-25 23:05:20 +01:00
Aymeric Augustin f1255a3c09 Fixed #18144 -- Restored compatibility with SHA1 hashes with empty salt.
Thanks dahool for the report and initial version of the patch.
2013-02-25 20:21:58 +01:00
Carl Meyer 906dc8522a Fixed #19854 -- Turn Django's own Selenium tests off by default. 2013-02-25 10:14:42 -07:00
Carl Meyer 87e8dfaa47 Switching to autoescape is not a change in syntax. 2013-02-25 00:43:03 -07:00
Carl Meyer 3ded2aef71 Remove leading underscore from a function that's all growed up now.
This function is now the de facto standard function for rendering values in a
template, and is imported by two other built-in template modules. It shouldn't
have a leading underscore.
2013-02-25 00:33:29 -07:00
Claude Paroz 5eebb49c69 Fixed #19908 -- Added missing import in forms.py
Thanks loic84 for the report.
2013-02-24 22:59:15 +01:00
Julien Phalip a8449d4362 Merge pull request #824 from ambv/languagecode 2013-02-24 12:56:14 -08:00
Julien Phalip 438ce4ec55 Fixed some docstrings that were raising Sphinx warnings when running the admindocs tests. 2013-02-24 12:03:24 -08:00
Florian Apolloner b88bf9f125 Fixed python 3 support. Refs #17320 2013-02-24 18:35:08 +01:00
Aymeric Augustin e3e0f49ece Merge pull request #834 from vdboor/issue_19906_list_classes
Added column-<field_name> classes to the admin list
2013-02-24 08:58:57 -08:00
Diederik van der Boor b7ba4fc408 Add column-<field_name> classes to the admin list
This simplifies CSS styling to set column widths.
2013-02-24 17:50:23 +01:00
Florian Apolloner 5e52dc2ade Merge pull request #828 from zerok/tickets/17320
Fixed #17320 -- Added whitespace validation to Site.domain field
2013-02-24 08:39:27 -08:00
Simon Charette 6b03179e12 Fixed #19688 -- Allow model subclassing with a custom metaclass using six.with_metaclass 2013-02-24 17:32:34 +01:00
Christopher Medrela 636c45fc58 Fixed #19890 -- ifchanged templatetag rendered its content twice
The content of ifchanged template tag was rendered twice: first time, to
compare it with the previous value and the second time, to return the
rendered output.
2013-02-24 16:49:28 +01:00
Horst Gutmann c729461479 Fixed #17320 -- Added whitespace validation to the Site.domain field 2013-02-24 16:40:51 +01:00
Diederik van der Boor 8503120c10 Fixed #15849 -- Made IfChanged node thread safe.
Previously, the ifchanged node stored state on `self._last_seen`,
thereby giving undesired results when the node is reused by another
thread at the same time (e.g. globally caching a Template object).

Thanks to akaihola for the report and Diederik van der Boor and
Bas Peschier for the patch.
2013-02-24 16:06:55 +01:00
Zbigniew Siciarz 0a8402eb05 Test case and docs for custom context data in feeds
Thanks Paul Winkler for the initial patch. (Ref #18112).
2013-02-24 08:33:20 -06:00
Florian Apolloner 4506ae0497 Merge pull request #717 from slurms/ticket_19746
Fixed #19746 -- Allow deserialization of pk-less data
2013-02-24 06:31:14 -08:00
Aymeric Augustin bc787f6a32 Loaded cycle and firstof from future in built-in templates. Refs #17906.
This was missing from f49e9a517f.
2013-02-24 15:16:45 +01:00
Łukasz Langa 8c8f94fe9d Fixes #19763 - LocaleMiddleware should check for supported languages in settings.LANGUAGE_CODE 2013-02-24 14:43:45 +01:00
Tomek Paczkowski 99edbe0e27 Fixed #19253 -- Extracted template cache key building logic
Introduced a public function
django.core.cache.utils.make_template_fragment_key
Thanks @chrismedrela for fruitful cooperation.
2013-02-24 14:32:45 +01:00
Joeri Bekker b9cc61021a Fixed #9084 - Best approach for an OS to atomically rename the session file. 2013-02-24 14:21:40 +01:00
Aymeric Augustin 7106a1e594 Merge pull request #819 from erikr/master
Fixed #16302 -- Ensured contrib.comments is IPv6 capable.
2013-02-24 05:02:00 -08:00
Erik Romijn ade992c61e Fixed #16302 -- Ensure contrib.comments is IPv6 capable
Changed the ip_address field for Comment to GenericIPAddressField. Added
instructions to the release notes on how to update the schema of existing
databases.
2013-02-24 13:58:38 +01:00
Bas Peschier 5a9b2bce24 Fixed #19810 -- MemcachedCache now uses pickle.HIGHEST_PROTOCOL 2013-02-24 13:56:15 +01:00
Honza Král d7e835f76d Merge pull request #820 from viciu/11295
Fixed #11295: If ModelAdmin.queryset returns a filtered QS don't require a 2nd count call
2013-02-24 04:35:27 -08:00
Aymeric Augustin a44531ae15 Fixed #18862 -- Honored script prefix in FlatPage.get_absolute_url. 2013-02-24 13:27:13 +01:00
Aymeric Augustin 4b01ee7a50 URL-encoded URLs in FlatPage.get_absolute_url. 2013-02-24 13:27:13 +01:00
Wiktor Kolodziej f07a5f0a21 Fixed #11295: If ModelAdmin.queryset returns a filtered QS don't require a 2nd count call
Original patch rewritten, added tests and get_filters_params method for ChangeList class.
Thanks Alex for the report.
2013-02-24 13:23:23 +01:00
Honza Král e4e1287590 Merge pull request #817 from rybaktomasz/ticket_5568
Fixes #5568 -- DROP INDEX subcommand
2013-02-24 04:02:26 -08:00
Honza Kral cbb9f629b8 Revert "fixes #19263" - Fails if not SQLite
This reverts commit 2b76f19f2b.
2013-02-24 12:38:32 +01:00
Tomasz Rybak d7429defe6 Add sqldropindexes to manage
Change patch from https://code.djangoproject.com/ticket/5568
to work on modern Django.
Add special case for MySQL which has different syntax for DROP INDEX.
Add unit tests for the new functionality.
2013-02-24 12:38:28 +01:00
George Song 44164c5c30 Fixed #19896 -- Committed after clearing cache in the database. 2013-02-24 12:15:02 +01:00
Florian Apolloner f56ca3f0e6 Fixed the usage of the deprecated assertEquals. 2013-02-24 11:15:17 +01:00
Preston Holmes 22d82a7742 Fixed #15198 -- pass request to AuthenticationForm
Thanks to Ciantic for the report, claudep and slurms for initial work
2013-02-23 15:28:49 -08:00
Preston Holmes 9d2c0a0ae6 Removed superfluous cookie check from auth login.
This is ensured through the CSRF protection of the view
2013-02-23 15:28:49 -08:00
Honza Král fc38d6a92b Merge pull request #813 from HiddenData/ticket-19263
fixes #19263 - EmptyResultSet in subquery causes incorrect SQL
2013-02-23 15:05:24 -08:00
Marcin Biernat 2b76f19f2b fixes #19263 2013-02-23 23:53:46 +01:00
Honza Král 692902b227 Merge pull request #778 from viciu/19609
Fixed #19609: admin Inlines doesn't display help_text for readonly fields
2013-02-23 14:34:57 -08:00
Honza Kral ef1e6ef1eb Merge branch 'ticket19872' of https://github.com/oinopion/django 2013-02-23 23:32:09 +01:00
Honza Kral 2b48fcc607 Fixed #18491 -- deleting a proxy doesn't show warning about cascade deletes 2013-02-23 23:20:34 +01:00
Tomek Paczkowski b88abd6840 Fixed #19872
Made cached_property to behave as property when accessed via class.
2013-02-23 23:20:00 +01:00
Aleksandra Sendecka 32a7ab2148 Fixed #19526
CSS specifications governs that syntax is case insensitive.
This modifies CachedFilesMixin to support that.
2013-02-23 23:05:22 +01:00
Klaas van Schelven 1c11ee6345 Fixed #18829 -- Fixed ModelChoiceIterator length
Thanks facundo.olano at gmail.com for the report and thikonom for
the initial patch.
2013-02-23 22:27:07 +01:00
Hernan Lozano 7e6ad76b24 Fixed #19282 -- Restored ability to pass Decimals to intcomma filter 2013-02-23 21:48:22 +01:00
Honza Král 10026c2ad0 Merge pull request #804 from oinopion/ticket18162
Fixes #18162 --  Specifying choices to Field overrides any form_class argument
2013-02-23 12:45:39 -08:00
Grzegorz Nosek 2cd0edaa47 Fixed 19895 -- Made second iteration over invalid queryset raise an exception too
When iteration over a queryset raised an exception, the result cache
remained initialized with an empty list, so subsequent iterations returned
an empty list instead of raising an exception
2013-02-23 14:35:27 -06:00
Łukasz Langa 539900f117 Fixes #17866: Vary: Accept-Language header when language prefix used 2013-02-23 19:41:33 +01:00
Claude Paroz 98ab8e8876 Fixed #19698 -- Cleared sites cache with signals
Thanks ddavies at nomensa.com for the report and the patch and
serdaroncode for reviewing the patch.
2013-02-23 19:31:17 +01:00
Honza Král 0a341ab40d Merge pull request #791 from khalas/ticket_19811
Changed %r to %s in get_language_info error message
2013-02-23 10:16:23 -08:00
Tomek Paczkowski b6f4a92ff4 Proposed fix for #18162. 2013-02-23 19:01:38 +01:00
Konrad Hałas 48dc0cbf2a Changed %r to %s in get_language_info error message. 2013-02-23 18:54:54 +01:00
Florian Apolloner 5ae0c933a8 Fixed errors introduced in 21f333bcef. Refs #17751 2013-02-23 18:43:34 +01:00
Claude Paroz cc53d9b30b Fixed #15877 -- Improved exception when ModelForm has no model class
Thanks theaspect at gmail.com for the report and volrath for the
patch.
2013-02-23 18:32:29 +01:00
Wiktor Kolodziej 67dd54dc84 Fixed #19609: admin Inlines doesn't display help_text for readonly fields
Refactoring: field was renamed to field_name, since flatten_fieldsets returns field name, not field.

Original patch from Marc Aymerich Gubern
2013-02-23 18:24:32 +01:00
Zbigniew Siciarz 1cd2f51eb4 Added test runner option to skip Selenium tests (#19854). 2013-02-23 17:45:26 +01:00
Lennart Regebro 687d2e967d Fixed #19827 -- Kept stacktrace in defaulttags exception reraising
Thanks Kronuz for the report and the initial patch.
2013-02-23 17:43:17 +01:00
Honza Král 0ad76843b5 Merge pull request #777 from khalas/ticket_19811
Fixed #19811 - Added language code fallback in get_language_info
2013-02-23 08:30:27 -08:00
Honza Král 129d2e8f85 Merge pull request #775 from HiddenData/ticket-18899
Fixed #18899 -- FileSystemStorage.save should support any file-like objects
2013-02-23 08:04:41 -08:00
Konrad Hałas 6bd6a56896 Fixed #19811 - Added language code fallback in get_language_info. 2013-02-23 17:02:07 +01:00
Mathijs de Bruin 8c1cc4b3b0 Fixed regression introduced in 146ed13a.
As override_settings was used after the initialization of the session backend,
we need to use a new session backend here.
2013-02-23 16:53:31 +01:00
Aymeric Augustin 5278776a88 Merge pull request #751 from bmispelon/ticket-6271 2013-02-23 07:47:58 -08:00
Marcin Biernat 664855b74e #18899 FileSystemStorage.save should support any file-like objects 2013-02-23 16:40:50 +01:00
Vladimir A Filonov f49e9a517f Fixed #17906 - Autoescaping {% cycle %} and {% firstof %} templatetags.
This commit adds "future" version of these two tags with auto-escaping
enabled.
2013-02-23 16:16:39 +01:00
Tomek Paczkowski 3dddbc0f23 Fixed #19816: pre-evaluate queryset on m2m set
In ReverseManyRelatedObjectsDescriptor.__set__, evaluate possible
queryset to avoid problems when clear() would touch data this queryset
returns.
2013-02-23 15:50:33 +01:00
Baptiste Mispelon 069280a689 Used token.split_contents() for tokenisation in template tags accepting variables.
Fixed #6271, #18260.
2013-02-23 15:15:30 +01:00
Jannis Leidel 6bbf4e57c8 Fixed embarrassing typo in last commit. 2013-02-23 14:59:51 +01:00
Florian Apolloner 67c39a64e0 Merge pull request #759 from erikr/master
Fix #17751: Added stripping of whitespace for IPAddressField/GenericIPAddressField
2013-02-23 05:58:48 -08:00
Erik Romijn 21f333bcef Fix #17751: Added stripping of whitespace for IPAddressField/GenericIPAddressField 2013-02-23 14:44:57 +01:00
fako 2db9cbe97c Removes document_root argument from django.contrib.staticfiles.views.serve
This argument can be removed, because the new way of finding static files doesn't take document_root into account at all.
2013-02-23 14:38:13 +01:00
Jannis Leidel c12891e8cd Fixed #19850 -- Use configured staticfiles storage to find the URL of a static file in the admin. 2013-02-23 14:36:51 +01:00
Horst Gutmann 2f4a4703e1 Fixed #19758 -- Avoided leaking email existence through the password reset form. 2013-02-23 14:31:21 +01:00
Klaas van Schelven 91c9470664 Method "save" in BaseModelFormSet is marked as alters_data
Fixes #17663
2013-02-23 13:01:28 +01:00
Claude Paroz 7ec2a21be1 Fixed #19686 -- Added HTML5 number input type
Thanks Simon Charette for his help on the patch. Refs #16630.
2013-02-23 10:18:08 +01:00
Claude Paroz e5a8df06be Fixed #19846 -- Optimized a dict of lists in BlockContext class
Thanks Curtis Maloney for the report and the patch.
2013-02-22 23:55:11 +01:00
Anssi Kääriäinen ce094e570e Fixed Oracle regression in last_executed_query() with unicode strings
The regression was likely caused by the fix in #19606 which adjusted
Oracle's unicode detection, though it seems this would have been an
issue in some configurations even before.
2013-02-23 00:27:39 +02:00
Anssi Kääriäinen 09fcb70c80 Fixed empty strings + to_field regression on Oracle
Querying the reverse side of nullable to_field relation, where both
sides can contain null values resulted in incorrect results. The reason
was not detecting '' as NULL.

Refs #17541
2013-02-23 00:05:31 +02:00
Baptiste Mispelon f13bfbec70 Fixed #19882 -- Smarter tokenizing of {% for %} tag arguments. 2013-02-22 19:19:33 +01:00
Aymeric Augustin 5488437ab6 Factored code and added a missing docstring. 2013-02-21 21:26:40 +01:00
Anssi Kääriäinen 3c6318e831 Fixed #19870 -- Regression in select_related in inheritance cases
There was a regression in case two models inherited the same parent,
and one contained a foreign key to other. When select_related travelled
the foreign key the other model reused the parent join made by the
first model. This was likely caused by Query.join_parent_model()
addition in commit 68985db482.

Thanks to Trac alias loic84 for report & tests.
2013-02-21 12:01:23 +02:00
Anssi Kääriäinen 50677b29af Made a couple of selenium tests wait for page loaded
The admin_widgets tests were issuing click() to the browser but
didn't wait for the effects of those clicks. This caused the resulting
request to be processed concurrently with the test case. When using
in-memory SQLite this caused weird failures.

Also added wait_page_loaded() to admin selenium tests for code
reuse.

Fixed #19856
2013-02-20 23:56:57 +02:00
Anssi Kääriäinen 10f9ba046f Cleaned up join promotion in query.combine() with OR
Refs #19849
2013-02-20 21:45:36 +02:00
Anssi Kääriäinen edf93127bf Removed join() promote kwarg
The join promote=True was over-aggressive in select_related handling.
After that was removed, the only other user was query.combine(). That
use case is very easy to handle locally, so there is no more need for
the join(promote=True) flag.

Refs #19849.
2013-02-20 21:43:44 +02:00
Anssi Kääriäinen 3fef304ff2 Refactored negated IS NULL handling
This one cleaned up add_filter() negated filter generation. As a side
effect split_exclude() was cleaned up, too.

Refs #19849
2013-02-20 21:34:01 +02:00
Alex Gaynor b55cde054e Added a db_constraint option to ForeignKeys.
This controls whether or not a database level cosntraint is created. This is useful in a few specialized circumstances, but in general should not be used!
2013-02-20 11:27:32 -08:00
Claude Paroz cb5545ea2d Fixed #19598 -- Fixed jQuery tagName retrieving
Thanks rj at rudiculous.net for the report.
2013-02-20 14:16:00 +01:00
Claude Paroz 4246fe6006 Replaced the obsolete toggle event handling JS function
The toggle(func1, func2) event handling function has been removed
in jQuery 1.9.
2013-02-20 13:54:59 +01:00
Claude Paroz 8bbca211b6 Fixed #14571 -- Updated embedded jQuery from 1.4.2 to 1.9.1
Thanks dArignac for the initial patch.
2013-02-20 13:52:15 +01:00
Alex Gaynor fd3a066ae3 This function is unused and should have been removed a few releases ago. 2013-02-19 18:05:02 -08:00
Aymeric Augustin 35c991aa06 Added a default limit to the maximum number of forms in a formset.
This is a security fix. Disclosure and advisory coming shortly.
2013-02-19 11:23:30 -07:00
Carl Meyer 1f39eafd60 Checked object permissions on admin history view.
This is a security fix. Disclosure and advisory coming shortly.

Patch by Russell Keith-Magee.
2013-02-19 11:23:30 -07:00
Carl Meyer c6d69c12ea Restrict the XML deserializer to prevent network and entity-expansion DoS attacks.
This is a security fix. Disclosure and advisory coming shortly.
2013-02-19 11:23:30 -07:00
Carl Meyer d51fb74360 Added a new required ALLOWED_HOSTS setting for HTTP host header validation.
This is a security fix; disclosure and advisory coming shortly.
2013-02-19 11:23:29 -07:00
Aymeric Augustin ebabd77291 Ensured a connection is established when checking the database version.
Fixed a test broken by 21765c0a. Refs #18135.
2013-02-19 10:51:24 +01:00
Aymeric Augustin 9a3988ca5a Implemented Oracle version as a cached property. 2013-02-19 10:50:22 +01:00
Anssi Kääriäinen b4492a8ca4 Fixed #19837 -- Refactored split_exclude() join generation
The refactoring mainly concentrates on making sure the inner and outer
query agree about the split position. The split position is where the
multijoin happens, and thus the split position also determines the
columns used in the "WHERE col1 IN (SELECT col2 from ...)" condition.

This commit fixes a regression caused by #10790 and commit
69597e5bcc. The regression was caused
by wrong cols in the split position.
2013-02-19 01:10:49 +02:00
Aymeric Augustin ffcfb19f47 Added required methods in BaseDatabaseWrapper.
I should have included this in 29628e0b6e.
2013-02-18 22:51:56 +01:00
Aymeric Augustin 21765c0a6c Implemented PostgreSQL version as a cached property. 2013-02-18 22:49:59 +01:00
Aymeric Augustin 7b8529d206 Removed duplicate caching of mysql_version.
The manual caching in self.server_version and the cached_property
decorator are redundant.
2013-02-18 22:13:05 +01:00
Aymeric Augustin 282b2f40cd Fixed #15119 -- Stopped pinging the MySQL server. 2013-02-18 22:12:19 +01:00
Aymeric Augustin aea98e8c53 Simplified MySQL version checking.
Django used to check the version of MySQL before handling the first
request, which required:
- opening a connection
- closing it, to avoid holding it idle until the first request.

This code isn't necessary any longer since Django dropped support for
some versions of MySQL, and other database backends don't implement a
similar dance. For consistency and maintenability, remove it.

Reverts 4423757c0c.

Closes #18135.
2013-02-18 21:46:26 +01:00
Aymeric Augustin 29628e0b6e Factored out common code in database backends. 2013-02-18 17:19:09 +01:00
Aymeric Augustin 09ca010768 Removed an unecessary function.
It was introduced by the refactoring in 5a4e63e6 and made redundant by
the refactoring in 18934677.
2013-02-18 11:38:21 +01:00
Claude Paroz 5ec0405a09 Fixed #19839 -- Isolated auth tests from customized TEMPLATE_LOADERS
Thanks limscoder for the report.
2013-02-18 09:22:25 +01:00
Claude Paroz 632361611c Fixed #19833 -- Fixed import parameter encoding in get_runner
Thanks Danilo Bargen for the report.
2013-02-16 13:31:13 +01:00
Aymeric Augustin e74e207cce Fixed #17260 -- Added time zone aware aggregation and lookups.
Thanks Carl Meyer for the review.

Squashed commit of the following:

commit 4f290bdb60
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 21:21:30 2013 +0100

    Used '0:00' instead of 'UTC' which doesn't always exist in Oracle.

    Thanks Ian Kelly for the suggestion.

commit 01b6366f3c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 13:38:43 2013 +0100

    Made tzname a parameter of datetime_extract/trunc_sql.

    This is required to work around a bug in Oracle.

commit 924a144ef8
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 14:47:44 2013 +0100

    Added support for parameters in SELECT clauses.

commit b4351d2890
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 22:30:22 2013 +0100

    Documented backwards incompatibilities in the two previous commits.

commit 91ef84713c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 09:42:31 2013 +0100

    Used QuerySet.datetimes for the admin's date_hierarchy.

commit 0d0de288a5
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 09:29:38 2013 +0100

    Used QuerySet.datetimes in date-based generic views.

commit 9c0859ff7c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:25 2013 +0100

    Implemented QuerySet.datetimes on Oracle.

commit 68ab511a4f
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:14 2013 +0100

    Implemented QuerySet.datetimes on MySQL.

commit 22d52681d3
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:42:29 2013 +0100

    Implemented QuerySet.datetimes on SQLite.

commit f6800fd04c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:03 2013 +0100

    Implemented QuerySet.datetimes on PostgreSQL.

commit 0c829c23f4
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:41:08 2013 +0100

    Added datetime-handling infrastructure in the ORM layers.

commit 104d82a777
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 10:05:55 2013 +0100

    Updated null_queries tests to avoid clashing with the __second lookup.

commit c01bbb3235
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 23:07:41 2013 +0100

    Updated tests of .dates().

    Replaced .dates() by .datetimes() for DateTimeFields.
    Replaced dates with datetimes in the expected output for DateFields.

commit 50fb7a5246
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:40:09 2013 +0100

    Updated and added tests for QuerySet.datetimes.

commit a8451a5004
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 22:34:46 2013 +0100

    Documented the new time lookups and updated the date lookups.

commit 29413eab2b
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 16:15:49 2013 +0100

    Documented QuerySet.datetimes and updated QuerySet.dates.
2013-02-16 09:19:04 +01:00
Claude Paroz 87854b0bdf Fixed geos test to prevent random failure
Points in the test fixtures have 20 as max coordinate.
2013-02-15 20:13:36 +01:00
Claude Paroz 35185495e3 Fixed #17066 -- Prevented TypeError in GeoIP.__del__
When garbaging GeoIP instances, it happens that GeoIP_delete is
already None.
Thanks mitar for the report and stefanw for tests.
2013-02-15 17:12:14 +01:00
Claude Paroz b19d83fc12 Improved input sanitizing with thousand separators
For languages with non-breaking space as thousand separator,
standard space input should also be allowed, as few people know
how to enter non-breaking space on keyboards. Refs #17217.
Thanks Alexey Boriskin for the report and initial patch.
2013-02-15 16:37:52 +01:00
Claude Paroz a8d1421dd9 Avoided unneeded assertion on Python 3
Fixes failure introduced in 02e5909f7a.
2013-02-15 16:09:31 +01:00
Claude Paroz 02e5909f7a Fixed #19807 -- Sanitized getpass input in createsuperuser
Python 2 getpass on Windows doesn't accept unicode, even when
containing only ascii chars.
Thanks Semmel for the report and tests.
2013-02-15 15:44:27 +01:00
Julien Phalip 400fba9ca8 Merge pull request #728 from jphalip/ticket-19829
Fixed #19829 -- Fixed index lookups for NumPy arrays in templates.
2013-02-15 00:12:45 -08:00
Alexey Boriskin b8061397ea Put unicode_literals into all formats.py 2013-02-15 09:02:44 +01:00
Julien Phalip 7d5e35cdb4 Fixed #19829 -- Fixed index lookups for NumPy arrays in templates. 2013-02-14 23:29:15 -08:00
Russell Keith-Magee f5e4a699ca Fixed #19822 -- Added validation for uniqueness on USERNAME_FIELD on custom User models.
Thanks to Claude Peroz for the draft patch.
2013-02-15 09:00:55 +08:00
Michael van Tellingen 138de533ff Fixed #19819 - Improved template filter errors handling.
Wrap the Parser.compile_filter method call with a try/except and call the
newly added Parser.compile_filter_error(). Overwrite this method in the
DebugParser to throw the correct error.

Since this error was otherwise catched by the compile_function try/except
block the debugger highlighted the wrong line.
2013-02-14 10:22:59 +01:00
Claude Paroz f1029b308f Fixed a misnamed variable introduced in commit 142ec8b283
Refs #8404.
2013-02-14 08:33:10 +01:00
Claude Paroz 142ec8b283 Fixed #8404 -- Isolated auth password-related tests from custom templates 2013-02-13 23:11:49 +01:00
Claude Paroz ac4faa6dc3 Fixed #19693 -- Made truncatewords_html handle self-closing tags
Thanks sneawo for the report and Jonathan Loy for the patch.
2013-02-13 18:24:49 +01:00
Hiroki Kiyohara e94f405d94 Fixed #18558 -- Added url property to HttpResponseRedirect*
Thanks coolRR for the report.
2013-02-13 10:29:32 +01:00
Carl Meyer 3a002db6f1 Fix admindocs on Python 3, where None cannot be sorted with strings.
This fixes two tests in admin_views which were failing on Python 3, but only if
the tests were run with docutils installed.
2013-02-12 17:10:36 -07:00
Anssi Kääriäinen fafee74306 Removed try-except in django.db.close_connection()
The reason was that the except clause needed to remove a connection
from the django.db.connections dict, but other parts of Django do not
expect this to happen. In addition the except clause was silently
swallowing the exception messages.

Refs #19707, special thanks to Carl Meyer for pointing out that this
approach should be taken.
2013-02-13 00:25:09 +02:00
Nick Sandford 278dad5b41 Fixed #19746 -- Allow deserialization of pk-less data 2013-02-12 17:10:42 +08:00
Aymeric Augustin 5a3d9490f1 Accepted None in tzname().
This is required by the tzinfo API, see Python's docs.

Also made _get_timezone_name deterministic.
2013-02-11 21:56:35 +01:00
Aymeric Augustin 7db770b013 Added a check in the creation of IS NULL clauses.
value_annotation isn't very well defined. Before this change, setting it
to datetime.datetime could silently reverse the behavior of isnull
lookups. This commit doesn't have any consequences on the current code.
It's just a safeguard for future ORM hackers.
2013-02-11 10:38:39 +01:00
Simon Charette a10f390804 Fixed #19044 -- Made `DeletionMixin` interpolate its `success_url`.
Thanks to nxvl and slurms for the initial patch, ptone for the review
and timo for the documentation tweaks.
2013-02-11 02:39:14 -05:00
Anssi Kääriäinen 5cc0f5f8c1 Made Query.clear_ordering force_empty arg mandatory
Previously it was possible to call clear_ordering without the
force_empty argument. The result was that the query was still ordered
by model's meta ordering if that was defined. By making the arg
mandatory it will be easier to spot possible errors caused by assuming
clear_ordering will remove all ordering.

Thanks to Dylan Klomparens for the suggestion. Refs #19720.
2013-02-10 20:58:25 +02:00
Anssi Kääriäinen 8ef3235034 Fixed #19720 -- Oracle ordering related delete regression
When a query had a complex where condition (a condition targeting more
than the base table) a subquery was used for deletion. However, the
query had default ordering from the model's meta and Oracle doesn't
work with ordered subqueries.

The regression was caused by fast-path deletion code introduced in
1cd6e04cd4 for fixing #18676.

Thanks to Dylan Klomparens for the report.
2013-02-10 19:54:02 +02:00
Anssi Kääriäinen 0478780b8e Fixed #19638 -- Skipped tx support testing for some DBs
PostgreSQL and Oracle always support transactions, so the create table
and rollback test is non-necessary on those DBs.

Thanks to shai for report.
2013-02-10 18:56:36 +02:00
Anssi Kääriäinen a4e97cf315 Fixed #19707 -- Reset transaction state after requests 2013-02-10 13:55:54 +02:00
Preston Holmes 0e18fb04ba Made modwsgi groups_for_user consistent with check_password
2b5f848207 based its changes on #19061
that made the is_active attribute mandatory for user models.
The try/except was not removed for the groups_for_user function.

refs #19780
2013-02-09 09:31:04 -08:00
Claude Paroz f44922c795 Fixed #18906 -- Ignored to-be-deleted forms in formset validate_unique
Thanks c.pollock at bangor.ac.uk for the report.
2013-02-08 21:35:19 +01:00
Claude Paroz 868e0f3cb4 Removed unneeded imports in db.models init 2013-02-08 17:11:33 +01:00
Claude Paroz 2ed90eac49 Fixed #19779 -- Checked contrib.sites presence in RedirectFallbackMiddleware
Thanks Aymeric Augustin for the report and directions for the patch.
2013-02-08 16:32:09 +01:00
Claude Paroz e486475a13 Moved import in db.backends.creation 2013-02-08 10:01:56 +01:00
Preston Holmes c44d748272 Fixed #19662 -- alter auth modelbackend to accept custom username fields
Thanks to Aymeric and Carl for the review.
2013-02-07 16:07:56 -08:00
Aymeric Augustin 64623a2e11 Fixed #19772 -- Handled APPEND_SLASH correctly in the redirects app. 2013-02-07 22:36:12 +01:00
Ramiro Morales 04d9730b12 Fixed #13085 -- Don't fail on creation of model with GFK to a model with __len__() returning zero.
Also, according to the comments on the ticket and its duplicates, added
tests execising saving an instance of a model with a GFK to:

* An unsaved object -- This actually doesn't generate the same failure
  but another ORM-level exception. The test verifies it's the case.

* An instance of a model with a __nonzero__() method thant returns False
  for it. This doesn't fail because that code path isn't executed.

* An instance of a model with a CharField PK and an empty value for it.
  This doesn't fail.
2013-02-07 16:05:54 -03:00
Florian Apolloner 2b916895a1 Updated createsuperuser to use unicode_literals. Refs #19757. 2013-02-07 14:33:36 +01:00
Aymeric Augustin 720888a146 Fixed #15808 -- Added optional HttpOnly flag to the CSRF Cookie.
Thanks Samuel Lavitt for the report and Sascha Peilicke for the patch.
2013-02-07 09:48:08 +01:00
Alexey Boriskin d18f796a48 Fixed #19704 -- Make use of new ungettext_lazy function at appropriate places 2013-02-06 22:01:55 +01:00
Claude Paroz d7504a3d7b Improved regex in strip_tags
Thanks Pablo Recio for the report. Refs #19237.
2013-02-06 21:20:43 +01:00
Simon Charette 5449240c54 Fixed #9800 -- Allow "isPermaLink" attribute in <guid> element of an RSS item.
Thanks @rtnpro for the patch!
2013-02-06 05:28:05 -05:00
Claude Paroz 2390fe3f4f Fixed #19745 -- Forced resolution of verbose names in createsupersuser
Thanks Baptiste Mispelon for the report and Preston Holmes for the review.
2013-02-06 10:06:21 +01:00
Simon Charette a097ee32d8 Fixed #17683 -- Make sure `BaseModelFormSet` respects defined widgets. 2013-02-05 05:39:35 -05:00
Simon Charette ec469ade2b Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`. 2013-02-05 04:16:07 -05:00
Ramiro Morales 826d9de00e Fixed #19729 -- Removed leftover refactoring helper variables.
Thanks chrismedrela for the report.

Refs #6262, 44b9076 and 4d94c0c.
2013-02-04 20:31:50 -03:00
Claude Paroz 7c5b244826 Fixed #17061 -- Factored out importing object from a dotted path
Thanks Carl Meyer for the report.
2013-02-04 16:38:25 +01:00
Aymeric Augustin 3f1c7b7053 Simplified default project template.
Squashed commit of:

commit 508ec9144b35c50794708225b496bde1eb5e60aa
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 22:50:55 2013 +0100

    Tweaked default settings file.

    * Explained why BASE_DIR exists.
    * Added a link to the database configuration options, and put it in its
      own section.
    * Moved sensitive settings that must be changed for production at the
      top.

commit 6515fd2f1aa73a86dc8dbd2ccf512ddb6b140d57
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 14:35:21 2013 +0100

    Documented the simplified app & project templates in the changelog.

commit 2c5b576c2ea91d84273a019b3d0b3b8b4da72f23
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 13:59:27 2013 +0100

    Minor fixes in tutorials 5 and 6.

commit 55a51531be8104f21b3cca3f6bf70b0a7139a041
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 13:51:11 2013 +0100

    Updated tutorial 2 for the new project template.

commit 29ddae87bdaecff12dd31b16b000c01efbde9e20
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 11:58:54 2013 +0100

    Updated tutorial 1 for the new project template.

commit 0ecb9f6e2514cfd26a678a280d471433375101a3
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 11:29:13 2013 +0100

    Adjusted the default URLconf detection to account for the admin.

    It's now enabled by default.

commit 5fb4da0d3d09dac28dd94e3fde92b9d4335c0565
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 10:36:55 2013 +0100

    Added security warnings for the most sensitive settings.

commit 718d84bd8ac4a42fb4b28ec93965de32680f091e
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 23:24:06 2013 +0100

    Used an absolute path for the SQLite database.

    This ensures the settings file works regardless of which directory
    django-admin.py / manage.py is invoked from.

    BASE_DIR got a +1 from a BDFL and another core dev. It doesn't involve
    the concept of a "Django project"; it's just a convenient way to express
    relative paths within the source code repository for non-Python files.

    Thanks Jacob Kaplan-Moss for the suggestion.

commit 1b559b4bcda622e10909b68fe5cab90db6727dd9
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 23:22:40 2013 +0100

    Removed STATIC_ROOT from the default settings template.

    It isn't necessary in development, and it confuses beginners to no end.

    Thanks Carl Meyer for the suggestion.

commit a55f141a500bb7c9a1bc259bbe1954c13b199671
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 23:21:43 2013 +0100

    Removed MEDIA_ROOT/URL from default settings template.

    Many sites will never deal with user-uploaded files, and MEDIA_ROOT is
    complicated to explain.

    Thanks Carl Meyer for the suggestion.

commit 44bf2f2441420fd9429ee9fe1f7207f92dd87e70
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:22:09 2013 +0100

    Removed logging config.

    This configuration is applied regardless of the value of LOGGING;
    duplicating it in LOGGING is confusing.

commit eac747e848eaed65fd5f6f254f0a7559d856f88f
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:05:31 2013 +0100

    Enabled the locale middleware by default.

    USE_I18N is True by default, and doesn't work well without
    LocaleMiddleware.

commit d806c62b2d00826dc2688c84b092627b8d571cab
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:03:16 2013 +0100

    Enabled clickjacking protection by default.

commit 99152c30e6a15003f0b6737dc78e87adf462aacb
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:01:48 2013 +0100

    Reorganized settings in logical sections, and trimmed comments.

commit d37ffdfcb24b7e0ec7cc113d07190f65fb12fb8a
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:54:11 2013 +0100

    Avoided misleading TEMPLATE_DEBUG = DEBUG.

    According to the docs TEMPLATE_DEBUG works only when DEBUG = True.

commit 15d9478d3a9850e85841e7cf09cf83050371c6bf
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:46:25 2013 +0100

    Removed STATICFILES_FINDERS/TEMPLATE_LOADERS from default settings file.

    Only developers with special needs ever need to change these settings.

commit 574da0eb5bfb4570883756914b4dbd7e20e1f61e
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:45:01 2013 +0100

    Removed STATICFILES/TEMPLATES_DIRS from default settings file.

    The current best practice is to put static files and templates in
    applications, for easier testing and deployment.

commit 8cb18dbe56629aa1be74718a07e7cc66b4f9c9f0
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:24:16 2013 +0100

    Removed settings related to email reporting from default settings file.

    While handy for small scale projects, it isn't exactly a best practice.

commit 8ecbfcb3638058f0c49922540f874a7d802d864f
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 18:54:43 2013 +0100

    Documented how to enable the sites framework.

commit 23fc91a6fa67d91ddd9d71b1c3e0dc26bdad9841
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:28:59 2013 +0100

    Disabled the sites framework by default.

    RequestSite does the job for single-domain websites.

commit c4d82eb8afc0eb8568bf9c4d12644272415e3960
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 00:08:33 2013 +0100

    Added a default admin.py to the application template.

    Thanks Ryan D Hiebert for the suggestion.

commit 4071dc771e5c44b1c5ebb9beecefb164ae465e22
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 10:59:49 2013 +0100

    Enabled the admin by default.

    Everyone uses the admin.

commit c807a31f8d89e7e7fd97380e3023f7983a8b6fcb
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 10:57:05 2013 +0100

    Removed admindocs from default project template.

commit 09e4ce0e652a97da1a9e285046a91c8ad7a9189c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:32:52 2013 +0100

    Added links to the settings documentation.

commit 5b8f5eaef364eb790fcde6f9e86f7d266074cca8
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 11:06:54 2013 +0100

    Used a significant example for URLconf includes.

commit 908e91d6fcee2a3cb51ca26ecdf12a6a24e69ef8
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:22:31 2013 +0100

    Moved code comments about WSGI to docs, and rewrote said docs.

commit 50417e51996146f891d08ca8b74dcc736a581932
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 15:51:50 2013 +0100

    Normalized the default application template.

    Removed the default test that 1 + 1 = 2, because it's been committed
    way too many times, in too many projects.

    Added an import of `render` for views, because the first view will
    often be:

    def home(request):
        return render(request, "mysite/home.html")
2013-02-04 13:21:36 +01:00
Ramiro Morales 21ea58b8cc Enhanced docs and docctrings added in 869c9ba.
Thanks Claude for the suggestion.
2013-02-04 08:55:45 -03:00
Claude Paroz 2edef932ff Revert "Fixed #19724 -- Output error when settings are improperly configured"
This reverts commit 40ca99097f.
Outputting error is not always suitable, for example this shouldn't
happen for the 'startproject' command.
2013-02-04 12:15:22 +01:00
Claude Paroz 40ca99097f Fixed #19724 -- Output error when settings are improperly configured
...during retrieval of available management commands.
Thanks Peter Davis for the report and Julien Phalip for the review.
2013-02-04 11:47:59 +01:00
Claude Paroz 55c585f1c7 Fixed #19725 -- Made createsuperuser handle non-ascii prompts
Thanks Michisu for the report.
2013-02-04 10:09:10 +01:00
Simon Charette fb606e10ac Fixed #19653 -- Removed `Manager.get_empty_query_set`. 2013-02-04 04:02:50 -05:00
Ramiro Morales 869c9ba306 Fixed #19730 -- Don't validate importability of settings by using i18n in management commands.
They are handled independently now and the latter can be influenced by
the new BaseCommand.leave_locale_alone internal option.

Thanks chrischambers for the report, Claude, lpiatek, neaf and gabooo for
their work on a patch, originally on refs. #17379.
2013-02-03 23:40:38 -03:00
Julien Phalip 293f7a2114 Fixed #17797 -- Enabled support for PATCH requests in the dummy test client. Thanks to pfarmer for the suggestion and initial patch. 2013-02-02 18:22:40 -08:00
Ramiro Morales 08dc90bccf Fixed #14305 -- Switched inspectdb to create unmanaged models.
Thanks Ian Kelly for the report and initial patch.
2013-02-02 21:11:32 -03:00
Julien Phalip c9c40bc6bc Fixed #19333 -- Moved compress.py outside of the admin static folder. Thanks to camilonova, Russell Keith-Magee, Aymeric Augustin and Ramiro Morales for the feedback. 2013-02-02 15:01:32 -08:00
Nick Sandford 0694d2196f Fixed #19445 -- Skip admin fieldsets validation when the ModelAdmin.get_form() method is overridden. 2013-02-02 14:53:46 -08:00
Claude Paroz a1c470a6f6 Lowered field ordering requirement in ogrinspect test
This test was randomly failing depending on the library environment.
2013-02-02 14:01:24 +01:00
Claude Paroz 1f8e7bb075 Added missing parentheses in if clause 2013-02-02 12:13:47 +01:00
Claude Paroz 63d6a50dd8 Fixed #18144 -- Added backwards compatibility with old unsalted MD5 passwords
Thanks apreobrazhensky at gmail.com for the report.
2013-02-02 12:02:36 +01:00
Aymeric Augustin ace9d4efc3 Made ungettext_lazy usable for messages that do not contain the count.
Fixed #19160 (again). Thanks Alexey Boriskin.
2013-02-02 10:58:31 +01:00
Claude Paroz 04141c525d Fixed #19663 -- Allowed None in colorize() text parameter
Thanks Jonathan Liuti for the report and the initial patch, and
Simon Charette for the review.
2013-02-01 22:53:18 +01:00
Aymeric Augustin 0412b7d280 Avoided ambiguous output when runserver port is already in use.
Thanks James Pic for the suggestion (PR 88).
2013-02-01 22:25:29 +01:00
Aymeric Augustin e0bd93ddd7 Merge pull request #334 from dlo/tickets/18755
Fixed #18755 -- Wrapped long admin forms fields labels.
2013-02-01 12:34:35 -08:00
Matt Robenolt 393c268e72 Fixed #19715 -- Simplified findstatic output when verbosity set to 0 2013-02-01 11:55:05 +01:00
Claude Paroz 8eb84081ad Set bigger maxDiff for ogrinspect tests 2013-02-01 09:34:39 +01:00
Claude Paroz b757e7ae18 Fixed dict randomization issue in inspectdb 2013-01-31 22:21:24 +01:00
Claude Paroz 7bbd17bf20 Fixed #19341 -- Detected NullBooleanField when introspecting models
Thanks Tim Bowden for the report.
2013-01-31 20:55:00 +01:00
Claude Paroz 3c0a81aaf0 Fixed #19709 -- Fixed TimeField introspection on MySQL
Thanks Eugene Grachev for the report.
2013-01-31 20:41:57 +01:00
Claude Paroz eb03fe1642 Added introspection tests for most of Django model fields 2013-01-31 20:41:57 +01:00
Aymeric Augustin 31308b3195 Merge pull request #690 from rafales/ticket_19711
Fixed #19711 -- Typo in django.test.simple.__all__
2013-01-31 10:44:08 -08:00
Rafal Stozek d877778bf3 Fixed #19711 -- Typo in __all__ declaration in django/test/simple.py 2013-01-31 19:40:38 +01:00
Ramiro Morales 7947c9e3a6 Deprecated undocumented warnings manipulation testing tools. 2013-01-31 14:57:45 -03:00
Aymeric Augustin 9a4a1ce323 Fixed #19708 -- Exception in timezone.override(None).
Thanks rafales.
2013-01-31 16:01:50 +01:00
Aymeric Augustin 89cb771be7 Fixed #19692 -- Completed deprecation of mimetype in favor of content_type.
Thanks Tim for the report and initial patch.
2013-01-31 13:54:40 +01:00
Claude Paroz 5b4805ae2b Merge pull request #686 from skrr/ticket_19703
Fixed #19703 -- Typo in get_declared_fields docstring
2013-01-30 13:29:56 -08:00
Claude Paroz fc8efc2d9e Fixed #19034 -- Added proper i18n pluralization for max/min length validation messages
This was made possible by commit 3f1a0c0040. Thanks Evil Clay
for the report and Alexey Boriskin his work on the ticket.
2013-01-30 21:44:14 +01:00
Aymeric Augustin 23e319d729 Fixed #19076 -- Added content_type attribute to TemplateView.
Thanks Gavin Wahl.
2013-01-30 21:26:17 +01:00
Aymeric Augustin 3f1a0c0040 Fixed #19160 -- Made lazy plural translations usable.
Many thanks to Alexey Boriskin, Claude Paroz and Julien Phalip.
2013-01-30 20:28:16 +01:00
Simon Kerr 52533a64d5 fixed minor typo #19703 2013-01-30 19:48:05 +01:00
Ramiro Morales 47ddd6a408 Fixed #19552 -- Enhanced makemessages handling of ``{# #}``-style template comments.
They are simply ignored now. This allows for a more correct behavior when
they are placed before translatable constructs on the same line.

Previously, the latter were wrongly ignored because the former were
preserved when converting template code to the internal Python-syntax
form later fed to xgettext but Python has no ``/* ... */``-style
comments.

Also, special comments directed to translators are now only taken in
account when they are located at the end of a line. e.g.::

  {# Translators: ignored #}{% trans "Literal A" %}{# Translators: valid, associated with "Literal B" below #}
  {% trans "Literal B" %}

Behavior of ``{% comment %}...{% endcomment %}``tags remains unchanged.

Thanks juneih at redpill-linpro dot com for the report and Claude for
his work on the issue.
2013-01-29 19:13:23 -03:00
Claude Paroz eb9430fc4b Implemented some SpatiaLiteOperations as cached properties
Previously, some properties weren't set unless
confirm_spatial_components_versions() was explicitely called.
2013-01-29 19:39:11 +01:00
Tim Graham ee26797cff Fixed typos in docs and comments 2013-01-29 10:55:55 -07:00
Claude Paroz f7394d2c32 Added HTML5 url input type
Refs #16630.
2013-01-28 22:11:00 +01:00
Claude Paroz 4f16376274 Added HTML5 email input type
Refs #16630.
2013-01-28 22:10:50 +01:00
Aymeric Augustin c47fa3b481 Fixed #19676 -- Supported 'self' foreign keys in inspectdb.
Thanks Georgy Kutsurua for the report and Simon Charette for the patch.
2013-01-28 10:21:07 +01:00
Aymeric Augustin f46d7314b5 Fixed #19677 -- Introspection of recursive foreign keys under SQLite.
Thanks Simon Charette.
2013-01-28 10:17:56 +01:00
Claude Paroz 4b3f7110ae Fixed #16123 -- Ensured strptime receive proper string type
strptime generates an UnicodeEncodeError when using a non-ascii
unicode string on Python 2.
2013-01-26 20:53:09 +01:00
Claude Paroz 962f133f72 Fixed #18483 -- Marked hidden field error string for translation
Thanks Evil Clay for the report and Emil Stenstrom for the initial
patch.
2013-01-26 19:59:44 +01:00
Aymeric Augustin 6605ac331a Fixed #17158 -- Used a non-ambiguous representation of SQL queries
when a correct representation cannot be obtained.
2013-01-26 17:51:44 +01:00
Claude Paroz d18893d5ce Moved BooleanField 'required' validation in validate() 2013-01-26 16:45:29 +01:00
Aymeric Augustin 55416e235d Fixed #19589 -- assertRegexpMatches is deprecated in Python 3.3. 2013-01-26 13:47:11 +01:00
Aymeric Augustin cebbec9b61 Fixed #19540 -- Stopped using deprecated os.stat_float_times. 2013-01-26 13:34:40 +01:00
Aymeric Augustin 424eb67867 Fixed validation of email addresses when the local part contains an @.
See also BaseUserManager.normalize_email -- it uses rsplit.

Refs #4833.
2013-01-26 12:20:57 +01:00
Claude Paroz 58062a6302 Used property decorators in django/forms.py 2013-01-25 22:41:45 +01:00
Claude Paroz 1686e0d184 Fixed #18460 -- Fixed change detection of ReadOnlyPasswordHashField
Thanks jose.sanchez et ezeep.com for the report and Vladimir Ulupov
for the initial patch.
2013-01-25 21:27:49 +01:00
Claude Paroz ebb504db69 Moved has_changed logic from widget to form field
Refs #16612. Thanks Aymeric Augustin for the suggestion.
2013-01-25 20:50:46 +01:00
Ramiro Morales ce27fb198d Revert "Patch by Claude for #16084."
This reverts commit 2babab0bb3.
2013-01-25 13:58:37 -03:00
Ramiro Morales 2babab0bb3 Patch by Claude for #16084. 2013-01-25 13:23:33 -03:00
Claude Paroz b9c8bbf372 Fixed #19665 -- Ensured proper stderr output for Command.run_from_argv
Thanks Stefan Koegl for the report and Simon Charette for the review.
2013-01-25 14:56:41 +01:00
Tim Graham eafc036476 Fixed #19577 - Added HTML escaping to admin examples.
Thanks foo@ for the report and Florian Apolloner for the review.
2013-01-25 06:53:40 -05:00
Ramiro Morales 1f6b2e7a65 Fixed #6682 -- Made shell's REPL actually execute $PYTHONSTARTUP and `~/.pythonrc.py`.
Also:

* Added a ``--no-startup`` option to disable this behavior. Previous
  logic to try to execute the code in charge of this funcionality was
  flawed (it only tried to do so if the user asked for ipython/bpython
  and they weren't found)
* Expand ``~`` in PYTHONSTARTUP value.

Thanks hekevintran at gmail dot com  for the report and initial patch.

Refs #3381.
2013-01-24 22:01:47 -03:00
Aymeric Augustin 57c6617c92 Minor optimization in the static serve view. 2013-01-24 11:01:32 +01:00
Claude Paroz 9893fa12b7 Fixed #19125 -- The startproject command should validate the name earlier
Thanks Łukasz Rekucki for the report and the patch.
2013-01-24 09:26:13 +01:00
Nick Sandford 93e79b45bc Fixed #17416 -- Added widgets argument to inlineformset_factory and modelformset_factory 2013-01-24 08:58:17 +01:00
Marc Tamlyn 389892aae5 Remove dup_select_related method.
This undocumented method was used in an old version of the admin, is
totally untested and hails from 2008. Although it's listed in the
"public methods" section, as it's not documented or used I don't think
it needs a deprecation path.

If we think it's useful I'll write some tests/docs for it instead...
2013-01-23 00:26:20 +00:00
Tim Graham 214fb700b9 Fixed #19477 - Documented generic_inlineformset_factory
Thanks epicserve for the suggestion.
2013-01-22 18:17:26 -05:00
Florian Apolloner cc4de61a2b Fixed #19596 -- Use `_default_manager` instead of `objects` in the auth app.
This is needed to support custom user models which don't define a manager
named `objects`.
2013-01-22 12:47:34 +01:00
Claude Paroz 013db6ba85 Fixed #18051 -- Allowed admin fieldsets to contain lists
Thanks Ricardo di Virgilio for the report, Mateus Gondim for the
patch and Nick Sandford for the review.
2013-01-21 22:34:36 +01:00
Claude Paroz c6e0dedbdb Fixed #19637 -- Ensured AdminEmailHandler fails silently
Thanks lsaffre for the report. Refs #19325.
2013-01-21 20:32:36 +01:00
Nick Sandford fe54377dae Fixed #17813 -- Added a .earliest() method to QuerySet
Thanks a lot to everybody participating in developing this feature.
The patch was developed by multiple people, at least Trac aliases
tonnzor, jimmysong, Fandekasp and slurms.

Stylistic changes added by committer.
2013-01-20 06:39:35 +02:00
Ramiro Morales 37718eb50b Fix in makemessages refactoring plus UI tweaks. 2013-01-19 12:58:33 -03:00
Claude Paroz 755f215590 Refactored makemessages command 2013-01-19 12:05:06 +01:00
Jani Tiainen d194f29057 Fixed #19606 -- Adjusted cx_Oracle unicode detection. 2013-01-19 09:27:16 +02:00
Anssi Kääriäinen 56f34f9f22 Removed models/related.py BoundRelatedObject
The class wasn't used anywhere except in RelatedObject.bind(), which
wasn't used anywhere. The class had one method defined as
NotImplemented, yet the class wasn't subclassed anywhere. In short, the
class was dead code.
2013-01-18 16:00:57 +02:00
Anssi Kääriäinen 3647c0a49a Avoided unnecessary recreation of RelatedObjects
Refs #19399. Thanks to Track alias KJ for the patch.
2013-01-18 07:09:39 +02:00
Craig Blaszczyk 6158c79dbe Made (make|compile)messages commands accept multiple locales at once.
Thanks Craig Blaszczyk for the initial patch. Refs #17181.
2013-01-17 00:53:17 -03:00
Ramiro Morales 248aee1606 Modified makemessages so it creates .pot files once per invocation.
It creates a `locale/django.pot` file once instead of one
`locale/<locale_code>/django.pot` file for every locale involved.

Thanks Michal Čihař for the report and patch.
2013-01-16 20:48:06 -03:00