Commit Graph

86 Commits

Author SHA1 Message Date
Tim Graham 893198509e Fixed #15625 -- Made message in MultiValueDictKeyError less verbose.
Thanks margieroginski for the suggestion.
2013-09-18 06:44:38 -04:00
Simon Charette 11cd7388f7 Fixed #20989 -- Removed useless explicit list comprehensions. 2013-08-30 10:57:51 -04:00
Tim Graham c7d0ff0cad Fixed #20989 -- Removed explicit list comprehension inside dict() and tuple()
Thanks jeroen.pulles at redslider.net for the suggestion and
helper script.
2013-08-29 12:11:03 -04:00
Andrew Godwin 7970d97a70 Docs tweaks (thanks timgraham) 2013-08-10 20:00:12 +01:00
Andrew Godwin 3c3d308ea3 Back SortedSet onto OrderedDict, rename it, and a few typo fixes 2013-08-10 19:50:06 +01:00
Andrew Godwin de64c4d6e9 Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/core/management/commands/flush.py
	django/core/management/commands/syncdb.py
	django/db/models/loading.py
	docs/internals/deprecation.txt
	docs/ref/django-admin.txt
	docs/releases/1.7.txt
2013-08-09 14:17:30 +01:00
Curtis Maloney 07876cf02b Deprecated SortedDict (replaced with collections.OrderedDict)
Thanks Loic Bistuer for the review.
2013-08-04 07:09:39 -04:00
Andrew Godwin b1e0ec06f0 Merge branch 'master' into schema-alteration 2013-07-02 10:49:53 +01:00
Ramiro Morales 7379d9acea Removed insert(), value_for_insert() SortedDict methods deprecated in Django 1.5. 2013-06-28 22:38:13 -03:00
Andrew Godwin cb4b0de49e Merge branch 'master' into schema-alteration 2013-05-10 12:55:30 +01:00
Andrew Godwin f6801a234f Adding a dependency graph class and tests 2013-05-10 12:52:04 +01:00
Claude Paroz 4769db6b5f Fixed #20321 -- Added missing key name in MergeDict KeyError message
Thanks mark.harviston et gmail.com for the report.
2013-04-26 08:59:34 +02:00
Anton Baklanov 59d127e45f Fixed #20276 -- Implemented __bool__ for MergeDict
MergeDict evaluates now to False if all contained dicts are empty.
Thanks til for the report and the initial patch.
2013-04-19 10:08:16 +02:00
Aymeric Augustin ef017a5f00 Advanced pending deprecation warnings.
Also added stacklevel argument, fixed #18127.
2012-12-29 21:59:07 +01:00
Anssi Kääriäinen fa18b0ac89 Some changes to SortedDict to make it faster under py2
Refs #19276
2012-11-13 22:48:25 +02:00
Mitar c3fabb282d Allow reversed iteration over SortedDict.
Iterators cannot be reversed easily without this method.
2012-10-15 04:16:46 -07:00
Alex Gaynor 4c97101b1f remove a bunch of unnescesarry iterkeys() calls 2012-08-08 07:33:15 -07:00
Aymeric Augustin ab6cd1c839 [py3] Updated dict-like data structures for Python 3.
The keys/items/values methods return iterators in Python 3, and the
iterkeys/items/values methods don't exist in Python 3. The behavior
under Python 2 is unchanged.
2012-07-25 22:58:48 +02:00
Aymeric Augustin f3c9a16a42 Fixed QueryDict.setlistdefault.
It was broken by a seemingly innocuous change in MultiValueDict.
Document the pitfall for now. This is fragile and should be
considered for refactoring.
2012-07-25 19:10:40 +02:00
Aymeric Augustin 942818e1b3 Rolled back a unnecessary change in 8f002867b2.
This keeps the implementation of setdefault and setlistdefault
consistent. Also it's marginally faster than looking up the value
again.
2012-07-25 10:16:35 +02:00
Alex Gaynor 38ce709fe4 Added tests for deprecation warnings and fixed the argument order for the warnings. 2012-07-24 07:01:57 -07:00
Alex Gaynor c57abd3c29 Remove DotExpandedDict, which was undocumented and unused. 2012-07-14 19:04:37 -07:00
Alex Gaynor 0f57935bcd Fix an incredibly emberassing typo. 2012-07-14 17:08:52 -07:00
Alex Gaynor 8b3c2f2c51 Deprecate two methods (which I seriously doubt anyone ever used, but they were documented so...) because they cannot be implemented efficiently on top of collections.SortedDict in Python 2.7 and up. 2012-07-14 16:08:42 -07:00
Alex Gaynor 8f002867b2 Cleaned up the QueryDict implementation.
- Use super().
- Don't poke at internals.
- Don't override methods for no reason.
2012-07-14 14:07:11 -07:00
Anssi Kääriäinen 4b11762f7d Fixed SortedDict.__copy__()
Fixed #18175 -- Calling SortedDict.__copy__() resulted in changes to
the original dictionary. The reason was likely related to subclassing
dict.

Thanks to linovia for report and patch.
2012-04-30 17:19:55 +03:00
Aymeric Augustin bd58612514 Fixed #17634 -- Optimized the performance of MultiValueDict by using append instead of copy and by minimizing the number of dict lookups. Refs #736.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17464 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-09 18:41:20 +00:00
Jannis Leidel 97f22f2969 Fixed #12375 -- Added a dict() method to convert a MultiValueDict (such as a QueryDict) to a dictionary of key-value pairs. Thanks, oinopion and hvdklauw.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16418 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-16 16:34:55 +00:00
Jannis Leidel fc8116cc4f Fixed #6580 -- Added `default` parameter to `MultiValueDict.getlist` method (the base class for `QueryDict`). Many thanks to mk and andrewebdev.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16260 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-22 15:05:29 +00:00
Adrian Holovaty 13864703bc Removed a bunch more Python 2.4 workarounds now that we don't support that version. Refs #15702 -- thanks to jonash for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28 02:11:19 +00:00
Alex Gaynor c6f90f0053 Fixed MultiValueDict's copy implementation to be consistant with all other copies.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14366 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-27 20:39:20 +00:00
Justin Bronn 1efa807703 Fixed #12632 -- Improved performance of `SortedDict`. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13742 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-11 02:28:16 +00:00
Malcolm Tredinnick 255147c97e Added more readable __str__ and __repr__ methods to MergeDict.
Thanks, john@calixto.net. Fixed #3508.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-10 19:24:24 +00:00
Joseph Kocherhans b3d20ade47 Fixed #12820. Implemented other dict methods for MergeDict. Thanks, Gisle Aas.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12498 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-22 23:38:18 +00:00
Adrian Holovaty 5ceed0a053 Changed a whole bunch of places to raise exception instances instead of old-style raising exception classes plus a comma. Good for the future Python 3 conversion
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10 18:36:20 +00:00
Russell Keith-Magee 0aa12da000 Fixed #12476 -- Forced the rollout of generators passed to SortedDict so that the data source can be read twice. Thanks to gsf for the report, and Alex for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12064 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-03 06:54:56 +00:00
Jacob Kaplan-Moss 574eafe4c0 Fixed #11753 - Q objects with callables no longer explode on Python 2.4. Thanks, Jeremy Dunck.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11901 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-17 22:06:41 +00:00
Russell Keith-Magee 333615accb Fixed #11874 -- Optimizations and cleanups for SortedDict. Thanks to Alex Gaynor and Armin Ronacher for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11815 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-12 06:00:59 +00:00
Jacob Kaplan-Moss c33355d86a As long as we're micro-optomizing, do it right -- using map() shaves another dozen or so seconds off the test suite run time.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11495 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-10 22:49:05 +00:00
Jacob Kaplan-Moss 9d1a7c203c Micro-optomization to SortedDict.values(). Yes, it looks silly, but it shaves 30 seconds (5%) off the run time of the test suite.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11494 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-10 22:23:24 +00:00
Jacob Kaplan-Moss 184ea1c91f Fixed #8847, #10370: added some missing methods to MultiValueDict after [8399]. Thanks, James Turk and rfk.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-31 06:30:07 +00:00
Jacob Kaplan-Moss 9ae873fcd8 Fixed #10184: QueryDicts with multiple values can now be safely pickled. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10240 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-31 05:14:13 +00:00
Malcolm Tredinnick 62b39322f3 Fixed #7496 -- It's now possible to pickle SortedDicts with pickle protocol 2
(used in caching). Thanks, John Huddleston.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 04:00:15 +00:00
Gary Wilson Jr 2b82a3bcfc Fixed #7331 -- Made `QueryDict.iteritems` behave like `QueryDict.items`, thanks jurev.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8399 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-16 02:17:55 +00:00
Jacob Kaplan-Moss d725cc9734 Fixed #2070: refactored Django's file upload capabilities.
A description of the new features can be found in the new [http://www.djangoproject.com/documentation/upload_handing/ upload handling documentation]; the executive summary is that Django will now happily handle uploads of large files without issues.

This changes the representation of uploaded files from dictionaries to bona fide objects; see BackwardsIncompatibleChanges for details.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7814 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-01 15:10:51 +00:00
Malcolm Tredinnick 915001ad0b Fixed #7109 -- Quote certain values before passing them for substitution in
Field.db_type().

This fixes a problem with using reserved words for field names in Oracle. Only
affects Oracle at the moment, but the same changes could easily be used by
other backends if they are required (requires changing creation.py, only).

This commit also reverts [7501] so that if the fix doesn't work, it will show
up in the tests (and if it does work, the tests will prevent us from breaking
it again).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7743 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 03:11:32 +00:00
Malcolm Tredinnick 54546f23f0 Fixed #6627 -- Made dict.clear() work for SortedDicts.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7140 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-21 21:27:44 +00:00
Malcolm Tredinnick e7b2ad8020 Fixed #6611 -- When copying a SortedDict, make a new copy of the keys list.
Thanks, Jeremy Dunck.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7129 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-18 23:08:51 +00:00
Adrian Holovaty 8b3f36029f Made a bunch of small doc rewordings from changes over the past couple of weeks
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7122 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-16 05:15:09 +00:00
Malcolm Tredinnick 2542b94fb2 Fixed #6465 -- Tweaked MergeDict.getlist() to work with Django's MultiValueDict class. Thanks, Matt McClanahan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7062 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-03 02:02:41 +00:00