Commit Graph

213 Commits

Author SHA1 Message Date
Bouke Haarsma 2bab9d6d9e Fixed #21389 -- Accept most valid language codes
By removing the 'supported' keyword from the detection methods and only relying
on a cached settings.LANGUAGES, the speed of said methods has been improved;
around 4x raw performance. This allows us to stop checking Python's incomplete
list of locales, and rely on a less restrictive regular expression for
accepting certain locales.

HTTP Accept-Language is defined as being case-insensitive, based on this fact
extra performance improvements have been made; it wouldn't make sense to
check for case differences.
2014-02-26 16:58:04 +01:00
Szczepan Cieślik e816198034 Fixed docs typos. 2014-02-25 10:28:32 -05:00
Erik Romijn 8cd32f0965 Fixed #22120 -- Documented persistent activation of languages and cleaned up language session key use 2014-02-22 18:29:06 +01:00
Erik Romijn 98f13762d7 Fixed #22123 -- EmailValidator now also accepts IPv6 literals in addresses 2014-02-22 17:45:33 +01:00
Baptiste Mispelon 926e18d7d1 Deprecated django.utils.text.javascript_quote.
Refs #21725.
2014-02-22 13:50:12 +01:00
Loic Bistuer 99416c7ad0 Added an example to the release notes for custom reverse managers. 2014-02-19 07:45:24 -05:00
Baptiste Darthenay b4f21d1807 Fixed #19647 -- Added formats.py for Esperanto.
Thanks to Objectivesea and Guttorm Flatabø (dittaeva)!
2014-02-19 11:58:20 +01: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
Marek Wywiał 8274fa60f8 Made the new template.Context.flatten() method a public API.
That method was introduced in 9db4271bd1.

Refs #21765.
2014-02-16 15:18:45 +01:00
Zbigniew Siciarz 74d4d58b62 Fixed #21939 -- Deprecated loading ssi/url tags from future. 2014-02-16 13:25:21 +01:00
Klemens Mantzos f683cb90be Fixed #21924 -- Added the ability to specify a reverse order for admin_order_field.
Thanks Klemens Mantzos for the report and initial patch.
2014-02-14 19:53:44 -05:00
Lukasz Balcerzak 0242134d32 Fixed #17942 -- Added a JsonResponse class to more easily create JSON encoded responses.
Thanks leahculver for the suggestion and Erik Romijn,
Simon Charette, and Marc Tamlyn for the reviews.
2014-02-14 18:25:19 -05:00
Antoine Catton e3d0790bd0 Fixed #21177 -- Made resolve_url support relative URLs.
This fixes redirecting to relative URLs with django.shortcuts.redirect.
2014-02-14 17:58:03 -05:00
Tim Graham e86aa83dc3 Fixed a link in the 1.7 release notes. 2014-02-13 10:32:50 -05:00
Jeremy f94f466cd3 Fixed #19496 -- Added truncatechars_html filter.
Thanks esevece for the suggestion and  Nick Sandford and Martin Warne
for the inital work on the patch.
2014-02-13 10:27:27 -05: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
Julian Wachholz 9a4ee8ddb8 Fixed #21994 -- Added form_dict argument to calls of WizardView.done()
Added an additional keyword argument ``form_dict`` to calls of
WizardView.done() implementations which allows easier access to validated
forms by their step name.
2014-02-10 07:28:39 -05:00
Si Feng b102c27ff4 Fixed #20784 -- Added inverse_match parameter to RegexValidator. 2014-02-10 05:38:43 -05:00
Tim Graham 29345390b8 Minor edits to new findstatic functionality; refs #19879.
Hopefully fixes a test failure on Jenkins.
2014-02-09 15:39:04 -05:00
Vajrasky Kok 6a9ed7d403 Fixed #19879 -- Have 'findstatic' says on which directories it searched the relative paths.
Added searched_locations in finders module. Added verbosity flag level 2 on 'findstatic'
command that will output the directories on which it searched the relative paths.

Reported by ccurvey. Initial patch by Jonas Svensson and Vajrasky Kok.
2014-02-09 14:22:22 +00:00
Jannis Leidel 5cc0555603 Fixed #21482 -- Uplifted restriction of collectstatic using symlink option in Windows NT 6.
Original patch by Vajrasky Kok. Reviewed by Florian Apolloner, Aymeric Augustin.
2014-02-09 12:39:20 +00:00
Andrew Godwin d5df7a0515 Fixed #21969: Fix behaviour of initial_data with migrated apps 2014-02-09 12:22:59 +00:00
Kevin Christopher Henry 6fe26bd3ee Fixed #19373 -- Ported Windows file locking from PyWin32 to ctypes
There wasn't any file locking under Windows unless PyWin32 was
installed. This removes that (undocumented) dependency by using ctypes
instead.

Thanks to Anatoly Techtonik for writing the ctypes port upon which this
is based.
2014-02-08 15:52:06 -05: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
Christopher Medrela b22d6c47a7 Fixed #17005 -- Added CurrentSiteMiddleware to set the current site on each request.
Thanks jordan at aace.org for the suggestion.
2014-02-06 04:45:49 -05:00
Loic Bistuer 36f260341a Extended the release notes for chainable Manager/QuerySet methods.
Refs #20625.
2014-02-05 18:30:45 -05:00
Claude Paroz 343dfff133 Removed the this_is_the_login_form hack
Refs #21911. Now that we have a more traditional login form, we
don't need any more a special field telling us we are dealing with
the login form.
2014-02-04 20:02:28 +01:00
Claude Paroz be0ad62994 Fixed #21911 -- Made admin views redirect to login when needed
Historically, the Django admin used to pass through the request
from an unauthorized access to the login view directly. Now we
are using a proper redirection, which is also preventing
inadvertantly changing data when POSTing login data to an admin
view when user is already authorized.
Thanks Marc Tamlyn and Tim Graham for the reviews.
2014-02-04 20:02:28 +01:00
Tim Graham d4a5019bef Reordered deprecation timeline and added back old info; refs #21920. 2014-02-03 08:32:32 -05:00
Simon Charette 10e3faf191 Fixed #19774 -- Deprecated the contenttypes.generic module.
It contained models, forms and admin objects causing undesirable
import side effects. Refs #16368.

Thanks to Ramiro, Carl and Loïc for the review.
2014-01-26 14:42:30 -05:00
Aymeric Augustin 9ffab9cee1 Moved RequestSite and get_current_site.
Following the app-loading refactor, these objects must live outside of
django.contrib.sites.models because they must be available without
importing the django.contrib.sites.models module when
django.contrib.sites isn't installed.

Refs #21680. Thanks Carl and Loic for reporting this issue.
2014-01-26 08:50:47 +01:00
Aymeric Augustin 2ff93e027c Fixed #21829 -- Added default AppConfigs.
Thanks Russell for the report, Marc for the initial patch, Carl for the
final review, and everyone who contributed to the design discussion.
2014-01-25 10:41:56 +01:00
Tim Graham 12303ab738 Fixed #21861 -- Fixed typo in 1.7 release notes.
Thanks marktranchant.
2014-01-23 09:29:09 -05:00
Jannis Leidel 8efd20f96d Added ManifestStaticFilesStorage to staticfiles contrib app.
It uses a static manifest file that is created when running
collectstatic in the JSON format.
2014-01-20 19:32:07 +01: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
Aymeric Augustin 10e0cfc0e4 Fixed #21712 -- Moved autodiscover() to AdminConfig.ready().
Thanks Marc Tamlyn for the initial version of the patch.
2014-01-18 23:06:00 +01:00
Anssi Kääriäinen 4dc3be2506 Fixed typos spotted by Claude Paroz 2014-01-18 22:31:35 +02:00
Anssi Kääriäinen 20bab2cf9d Fixed #16187 -- refactored ORM lookup system
Allowed users to specify which lookups or transforms ("nested lookus")
are available for fields. The implementation is now class based.

Squashed commit of the following:

commit fa7a7195f1
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 18 10:53:24 2014 +0200

    Added lookup registration API docs

commit eb1c8ce164
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Tue Jan 14 18:59:36 2014 +0200

    Release notes and other minor docs changes

commit 11501c29c9
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 20:53:03 2014 +0200

    Forgot to add custom_lookups tests in prev commit

commit 83173b960e
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 19:59:12 2014 +0200

    Renamed Extract -> Transform

commit 3b18d9f3a1
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 19:51:53 2014 +0200

    Removed suggestion of temporary lookup registration from docs

commit 21d0c7631c
Merge: 2509006 f2dc442
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 09:38:23 2014 -0800

    Merge pull request #2 from mjtamlyn/lookups_3

    Reworked custom lookups docs.

commit f2dc4429a1
Author: Marc Tamlyn <marc.tamlyn@gmail.com>
Date:   Sun Jan 12 13:15:05 2014 +0000

    Reworked custom lookups docs.

    Mostly just formatting and rewording, but also replaced the example
    using ``YearExtract`` to  use an example which is unlikely to ever be
    possible directly in the ORM.

commit 2509006506
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 13:19:13 2014 +0200

    Removed unused import

commit 4fba5dfaa0
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 22:34:41 2014 +0200

    Added docs to index

commit 6d53963f37
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 22:10:24 2014 +0200

    Dead code removal

commit f9cc039007
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 19:00:43 2014 +0200

    A new try for docs

commit 33aa18a6e3
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 14:57:12 2014 +0200

    Renamed get_cols to get_group_by_cols

commit c7d5f8661b
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 14:45:53 2014 +0200

    Altered query string customization for backends vendors

    The new way is trying to call first method 'as_' + connection.vendor.
    If that doesn't exist, then call as_sql().

    Also altered how lookup registration is done. There is now
    RegisterLookupMixin class that is used by Field, Extract and
    sql.Aggregate. This allows one to register lookups for extracts and
    aggregates in the same way lookup registration is done for fields.

commit 90e7004ec1
Merge: 66649ff f7c2c0a
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 13:21:01 2014 +0200

    Merge branch 'master' into lookups_3

commit 66649ff891
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 13:16:01 2014 +0200

    Some rewording in docs

commit 31b8faa627
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 29 15:52:29 2013 +0200

    Cleanup based on review comments

commit 1016159f34
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 28 18:37:04 2013 +0200

    Proof-of-concept fix for #16731

    Implemented only for SQLite and PostgreSQL, and only for startswith
    and istartswith lookups.

commit 193cd097ca
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 28 17:57:58 2013 +0200

    Fixed #11722 -- iexact=F() produced invalid SQL

commit 08ed3c3b49
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 23:59:52 2013 +0200

    Made Lookup and Extract available from django.db.models

commit b99c8d83c9
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 23:06:29 2013 +0200

    Fixed review notes by Loic

commit 049eebc070
Merge: ed8fab7 b80a835
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 22:53:10 2013 +0200

    Merge branch 'master' into lookups_3

    Conflicts:
    	django/db/models/fields/__init__.py
    	django/db/models/sql/compiler.py
    	django/db/models/sql/query.py
    	tests/null_queries/tests.py

commit ed8fab7fe8
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 22:47:23 2013 +0200

    Made Extracts aware of full lookup path

commit 27a57b7aed
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 21:10:11 2013 +0200

    Removed debugger import

commit 074e0f5aca
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 21:02:16 2013 +0200

    GIS lookup support added

commit 760e28e72b
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 20:04:31 2013 +0200

    Removed usage of Constraint, used Lookup instead

commit eac4776684
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 02:22:30 2013 +0200

    Minor cleanup of Lookup API

commit 2adf50428d
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 02:14:19 2013 +0200

    Added documentation, polished implementation

commit 32c04357a8
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Nov 30 23:10:15 2013 +0200

    Avoid OrderedDict creation on lookup aggregate check

commit 7c8b3a32cc
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Nov 30 23:04:34 2013 +0200

    Implemented nested lookups

    But there is no support of using lookups outside filtering yet.

commit 4d219d4cde
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Wed Nov 27 22:07:30 2013 +0200

    Initial implementation of custom lookups
2014-01-18 11:46:19 +02:00
Aymeric Augustin fbe1abac4a Fixed #21453 -- Enabled autocommit before calling init_connection_state.
Also ensured the transaction state is clean on Oracle while I was there.

This change cannot be backported to 1.6 because it's
backwards-incompatible for custom database backends.
2014-01-12 20:31:07 +01:00
Claude Paroz 0179852d7f Fixed #8898 -- Obsoleted SplitDateTimeWidget usage with DateTimeField
Thanks Tim Graham for the review.
2014-01-11 15:50:34 +01:00
Aymeric Augustin 3326a412cc Deprecated importing a model before loading its application.
Refs #21719, #21680.
2014-01-10 23:43:10 +01:00
Unai Zalakain 9eb16031ca Fixed #12571 -- Attached originating WSGIRequest to test client responses.
Originating WSGIRequests are now attached to the ``wsgi_request`` attribute of
the ``HttpResponse`` returned by the testing client.

Thanks rvdrijst for the suggestion.
2014-01-09 18:50:03 -05:00
Aymeric Augustin 021b0b0029 Added an app-loading feature to the release notes. 2014-01-05 21:10:15 +01:00
Aymeric Augustin f630373b92 Fixed #21711 -- Enforced unicity of model names. 2014-01-05 20:52:53 +01:00
Marc Tamlyn 7a30eab06e Fix typo in 0ce945a671.
Thanks to Loic for the report.
2014-01-02 09:06:52 +00:00
Aymeric Augustin 1386075f62 Updated release notes on app_label.
Django determines automatically which application models belong to,
provided the application can be imported without importing models.
2014-01-01 19:45:43 +01:00
Aymeric Augustin 0ce945a671 Fixed #21018 -- Reversed precedence order for management commands. 2014-01-01 18:11:15 +01:00