Commit Graph

654 Commits

Author SHA1 Message Date
Aymeric Augustin ee191715ea [py3] Fixed access to dict keys/values/items. 2012-08-07 12:00:22 +02:00
Tim Graham 86c5c0154f Fixed a mistake in function documentation 'django.utils.functional.partition'
Thanks Raman Barkholenka for the patch.
2012-08-04 18:56:43 -04:00
Aymeric Augustin d01eaf7104 [py3] Removed uses of sys.maxint under Python 3.
Also fixed #18706: improved exceptions raised by int_to_base36.
2012-08-03 18:51:28 +02:00
Alex Gaynor 129f1ac848 Remove a temporary variable deletion, it's not a big deal and it doesn't exist on python3. 2012-08-03 07:10:04 -07:00
Alex Gaynor e567f439bd Merge pull request #225 from dekkers/remove-double-isinstance-check
Remove double isinstance check in force_unicode
2012-07-29 17:07:55 -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
Florian Apolloner 59d99772f0 Merge pull request #216 from ljosa/ticket_18644
Fixed #18644 -- Made urlize trim trailing period followed by parenthesis
2012-07-25 13:22:49 -07: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
Jeroen Dekkers 226a3e7e00 Remove double isinstance check in force_unicode 2012-07-24 00:45:40 +02:00
Claude Paroz 690cabe203 Used a Python 3-compatible syntax for building a translation table 2012-07-22 18:05:53 +02:00
Aymeric Augustin a84d79f572 [py3] Added Python 3 compatibility for xrange. 2012-07-22 09:29:56 +02:00
Aymeric Augustin ca07fda2ef [py3] Switched to Python 3-compatible imports.
xrange/range will be dealt with in a separate commit due to the huge
number of changes.
2012-07-22 09:29:56 +02:00
Aymeric Augustin 0d914d08a0 [py3] Updated urllib/urllib2/urlparse imports.
Lots of functions were moved. Use explicit imports in all cases
to keey it easy to identify where the functions come from.
2012-07-22 09:29:55 +02:00
Aymeric Augustin bdca5ea345 [py3] Replaced unicode/str by six.text_type/bytes. 2012-07-22 09:29:54 +02:00
Aymeric Augustin 3cb2457f46 [py3] Replaced basestring by six.string_types. 2012-07-22 09:29:54 +02:00
Aymeric Augustin 56dbe924a6 [py3] Removed longs. 2012-07-22 09:29:53 +02:00
Aymeric Augustin 473d5f4ba1 [py3] Fixed django.utils.six.moves.
It didn't work because six was inside django.utils.
2012-07-22 09:29:51 +02:00
Aymeric Augustin 8b01909841 [py3] Bundled six for Python 3 compatibility.
Refs #18363.
2012-07-22 09:29:44 +02:00
Aymeric Augustin 38c18f1747 Switched to octal notation (bis). 2012-07-20 13:42:44 +02:00
Aymeric Augustin 324d48d0a7 Switched to Python 3-compatible octal notation. 2012-07-20 13:28:36 +02:00
Vebjorn Ljosa d5012d6371 Fixed #18644 -- Made urlize trim trailing period followed by parenthesis 2012-07-17 12:44:02 -04: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
Aymeric Augustin 9a25d8618a Update links to diveintomark.org.
These pages are gone.
2012-07-14 12:32:39 +02:00
Guilherme Gondim 91e4f7effb Fix copyright holder 2012-07-06 15:24:07 -03:00
Luke Plant bee498f3a2 Added 'format_html' utility for formatting HTML fragments safely 2012-07-03 22:20:12 +01:00
Luke Plant f33e150369 Documented utils.html.escape and conditional_escape 2012-07-03 22:20:12 +01:00
Florian Apolloner 6bc1b22299 Fixed our HTMLParser patches for python 2.7.4 2012-06-22 15:09:26 +02:00
Claude Paroz fe873e2765 Fixed #12140 -- Fixed http.urlencode result for empty lists
Thanks aneil for the report and the initial patch.
2012-06-14 11:32:40 +02:00
Anssi Kääriäinen 90985048fc Used git log instead of git show for last commit's timestamp
The reason for this was that git show included the whole changeset in
the output, but only the UTC timestamp was needed. By using git log
it is possible to get just the timestamp. The whole changeset can be
large, and can cause unicode encoding errors.
2012-06-08 23:04:03 +03:00
Claude Paroz 5e6ded2e58 Fixed #18363 -- Added Python 3 compatibility layer.
Thanks Vinay Sajip for the support of his django3 branch
and Alex Gaynor, kezabelle, YorikSar for the review.
2012-06-07 18:36:53 +02:00
Claude Paroz 4a103086d5 Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.
Thanks Vinay Sajip for the support of his django3 branch and
Jannis Leidel for the review.
2012-06-07 18:08:47 +02:00
Claude Paroz eb286aa22f Delayed encoding of password and salt in password checking.
Applied the rule that string encoding should happen as late as
possible. This is also a preparation for Python 3 compatibility.
2012-06-06 10:53:16 +02:00
Claude Paroz 28e424532f Removed unneeded smart_str in cache utils. 2012-05-28 21:13:09 +02:00
Claude Paroz 817535d73e Replaced types.NoneType occurrences
In Python 3, types.NoneType is no more available.
2012-05-23 12:20:03 +02:00
Claude Paroz 35e6585568 Imported reduce from functools for forward compatibility.
In Python 3, reduce has to be imported from functools.
2012-05-20 00:25:46 +02:00
Claude Paroz 38408f8007 Marked bytestrings with b prefix. Refs #18269
This is a preparation for unicode literals general usage in
Django (Python 3 compatibility).
2012-05-19 17:43:34 +02:00
Claude Paroz d04f72fb31 Got rid of old __cmp__methods replaced by rich comparison.
The __cmp__ methods are unsupported in Python 3.
_doctest.py has been left untouched because it is likely it will
not be migrated to Python 3.
2012-05-18 14:52:24 +02:00
Adrian Holovaty 25128856f5 Fixed typo in utils/archive.py docstring 2012-05-11 13:51:19 -05:00
Claude Paroz 169b1a404c Replaced foo.next() by next(foo).
This new syntax for next() has been introduced in Python 2.6 and is
compatible with Python 3.
2012-05-10 20:15:49 +02:00
Anssi Kääriäinen 9877e84caa Fixed total_ordering for Python < 2.7.2
The total_ordering in Python versions prior to 2.7.2 is buggy, and
this caused infinite recursion for Field comparisons on those
versions. Use the borrowed total_ordering for all Python versions
prior to 2.7.2.

The buggy total_ordering was introduced in commit
5cbfb48b92
2012-05-07 21:03:21 +03:00
Simon Charette 5cbfb48b92 Made model fields comparable to other objects
Fixed #17851 -- Added __lt__ and @total_ordering to models.Field,
made sure these work correctly on other objects than Field, too.
2012-05-07 20:08:20 +03:00
Claude Paroz d7dfab59ea Replaced cStringIO.StringIO by io.BytesIO.
Also replaced StringIO.StringIO by BytesIO in some other appropriate
places. StringIO is not available in Python 3.
2012-05-05 21:41:44 +02:00
Alex Gaynor 1583d40224 Fixed the syntax used for the Python repl examples in docs and docstrings. 2012-05-05 09:54:30 -05:00
Claude Paroz 865cd35c9b Made more extensive usage of context managers with open. 2012-05-05 14:06:36 +02:00
Aymeric Augustin e84f79f051 Fixed #18042 -- Advanced deprecation warnings.
Thanks Ramiro for the patch.
2012-05-03 15:27:01 +02:00