summaryrefslogtreecommitdiff
path: root/django/utils/datastructures.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge branch 'master' into schema-alterationAndrew Godwin2013-05-101-1/+7
|\ \ | |/
| * Fixed #20321 -- Added missing key name in MergeDict KeyError messageClaude Paroz2013-04-261-1/+1
| | | | | | | | Thanks mark.harviston et gmail.com for the report.
| * Fixed #20276 -- Implemented __bool__ for MergeDictAnton Baklanov2013-04-191-0/+6
| | | | | | | | | | MergeDict evaluates now to False if all contained dicts are empty. Thanks til for the report and the initial patch.
* | Adding a dependency graph class and testsAndrew Godwin2013-05-101-0/+30
|/
* Advanced pending deprecation warnings.Aymeric Augustin2012-12-291-2/+2
| | | | Also added stacklevel argument, fixed #18127.
* Some changes to SortedDict to make it faster under py2Anssi Kääriäinen2012-11-131-19/+14
| | | | Refs #19276
* Allow reversed iteration over SortedDict.Mitar2012-10-151-0/+3
| | | Iterators cannot be reversed easily without this method.
* remove a bunch of unnescesarry iterkeys() callsAlex Gaynor2012-08-081-1/+1
|
* [py3] Updated dict-like data structures for Python 3.Aymeric Augustin2012-07-251-55/+80
| | | | | | 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.
* Fixed QueryDict.setlistdefault.Aymeric Augustin2012-07-251-2/+4
| | | | | | It was broken by a seemingly innocuous change in MultiValueDict. Document the pitfall for now. This is fragile and should be considered for refactoring.
* Rolled back a unnecessary change in 8f002867b2.Aymeric Augustin2012-07-251-0/+1
| | | | | | This keeps the implementation of setdefault and setlistdefault consistent. Also it's marginally faster than looking up the value again.
* Added tests for deprecation warnings and fixed the argument order for the ↵Alex Gaynor2012-07-241-4/+8
| | | | warnings.
* Remove DotExpandedDict, which was undocumented and unused.Alex Gaynor2012-07-141-32/+0
|
* Fix an incredibly emberassing typo.Alex Gaynor2012-07-141-3/+3
|
* Deprecate two methods (which I seriously doubt anyone ever used, but they ↵Alex Gaynor2012-07-141-0/+9
| | | | were documented so...) because they cannot be implemented efficiently on top of collections.SortedDict in Python 2.7 and up.
* Cleaned up the QueryDict implementation.Alex Gaynor2012-07-141-1/+0
| | | | | | - Use super(). - Don't poke at internals. - Don't override methods for no reason.
* Fixed SortedDict.__copy__()Anssi Kääriäinen2012-04-301-3/+7
| | | | | | | | 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.
* Fixed #17634 -- Optimized the performance of MultiValueDict by using append ↵Aymeric Augustin2012-02-091-9/+12
| | | | | | 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
* Fixed #12375 -- Added a dict() method to convert a MultiValueDict (such as a ↵Jannis Leidel2011-06-161-0/+6
| | | | | | 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
* Fixed #6580 -- Added `default` parameter to `MultiValueDict.getlist` method ↵Jannis Leidel2011-05-221-2/+8
| | | | | | (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
* Removed a bunch more Python 2.4 workarounds now that we don't support that ↵Adrian Holovaty2011-03-281-6/+3
| | | | | | 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
* Fixed MultiValueDict's copy implementation to be consistant with all other ↵Alex Gaynor2010-10-271-5/+7
| | | | | | copies. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14366 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12632 -- Improved performance of `SortedDict`. Thanks, Alex Gaynor.Justin Bronn2010-09-111-1/+3
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@13742 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Added more readable __str__ and __repr__ methods to MergeDict.Malcolm Tredinnick2010-09-101-0/+21
| | | | | | Thanks, john@calixto.net. Fixed #3508. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12820. Implemented other dict methods for MergeDict. Thanks, Gisle Aas.Joseph Kocherhans2010-02-221-4/+26
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@12498 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Changed a whole bunch of places to raise exception instances instead of ↵Adrian Holovaty2010-01-101-4/+4
| | | | | | 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
* Fixed #12476 -- Forced the rollout of generators passed to SortedDict so ↵Russell Keith-Magee2010-01-031-0/+7
| | | | | | 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
* Fixed #11753 - Q objects with callables no longer explode on Python 2.4. ↵Jacob Kaplan-Moss2009-12-171-2/+2
| | | | | | Thanks, Jeremy Dunck. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11901 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #11874 -- Optimizations and cleanups for SortedDict. Thanks to Alex ↵Russell Keith-Magee2009-12-121-16/+17
| | | | | | 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
* As long as we're micro-optomizing, do it right -- using map() shaves another ↵Jacob Kaplan-Moss2009-09-101-2/+1
| | | | | | 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
* Micro-optomization to SortedDict.values(). Yes, it looks silly, but it ↵Jacob Kaplan-Moss2009-09-101-1/+2
| | | | | | 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
* Fixed #8847, #10370: added some missing methods to MultiValueDict after ↵Jacob Kaplan-Moss2009-03-311-1/+10
| | | | | | [8399]. Thanks, James Turk and rfk. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #10184: QueryDicts with multiple values can now be safely pickled. ↵Jacob Kaplan-Moss2009-03-311-1/+12
| | | | | | Thanks, Alex Gaynor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10240 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7496 -- It's now possible to pickle SortedDicts with pickle protocol 2Malcolm Tredinnick2008-08-251-0/+5
| | | | | | | (used in caching). Thanks, John Huddleston. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7331 -- Made `QueryDict.iteritems` behave like `QueryDict.items`, ↵Gary Wilson Jr2008-08-161-0/+8
| | | | | | thanks jurev. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8399 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2070: refactored Django's file upload capabilities.Jacob Kaplan-Moss2008-07-011-9/+41
| | | | | | | | | 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
* Fixed #7109 -- Quote certain values before passing them for substitution inMalcolm Tredinnick2008-06-261-0/+31
| | | | | | | | | | | | | | | 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
* Fixed #6627 -- Made dict.clear() work for SortedDicts.Malcolm Tredinnick2008-02-211-0/+4
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@7140 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #6611 -- When copying a SortedDict, make a new copy of the keys list.Malcolm Tredinnick2008-02-181-1/+1
| | | | | | | Thanks, Jeremy Dunck. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7129 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Made a bunch of small doc rewordings from changes over the past couple of weeksAdrian Holovaty2008-02-161-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@7122 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #6465 -- Tweaked MergeDict.getlist() to work with Django's ↵Malcolm Tredinnick2008-02-031-4/+5
| | | | | | MultiValueDict class. Thanks, Matt McClanahan. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7062 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Edited docstring changes from [6714]Adrian Holovaty2007-12-011-3/+3
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@6800 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #6050 -- Handled edge-case of duplicate keys being passed whenMalcolm Tredinnick2007-11-291-1/+4
| | | | | | | initialising SortedDict. Patch from Collin Grady and SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6751 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Made `MultiValueDict`'s `get` and `getlist` method docstrings more descriptive.Gary Wilson Jr2007-11-251-2/+8
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@6714 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Minor styling fix in `DotExpandedDict.__init__`.Gary Wilson Jr2007-11-251-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@6713 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Changed several hardcoding of `dict` method calls in ↵Gary Wilson Jr2007-11-251-19/+20
| | | | | | `django.utils.datastructures.py` to use `super` instead. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6712 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* In `MergeDict` class, changed variable names to not clash with `dict` builtin.Gary Wilson Jr2007-11-251-10/+10
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@6711 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Simplified `SortedDict.__deepcopy__` now that the its constructor can take a ↵Gary Wilson Jr2007-11-121-5/+3
| | | | | | sequence of tuples. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6669 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5183 -- Added __deepcopy__, pop() and popitem() to SortedDict. Based onMalcolm Tredinnick2007-10-221-0/+21
| | | | | | | a patch from David Blewett. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6593 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Django coding style fixes.Gary Wilson Jr2007-10-191-20/+29
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@6528 bcc190cf-cafb-0310-a4f2-bffc1f526a37