1
0
mirror of https://github.com/django/django.git synced 2025-03-10 01:12:53 +00:00

8174 Commits

Author SHA1 Message Date
Claude Paroz
c35501a128 [py3] Fixed HttpResponse when initialized with bytes 2012-08-14 16:15:50 +02:00
Alex Gaynor
a351e383b6 There's no need to do list(dict.keys()) list(dict)` is enough. 2012-08-14 06:57:16 -07:00
Anssi Kääriäinen
4e7f04cdad [py3] Fixed file.read().decode(), used codecs.open() instead 2012-08-14 16:09:01 +03:00
Anssi Kääriäinen
62a9ed0ac7 [py3] Fixed F-expression division operators
In Python 3 dividing by int will call obj.__truediv__(). This operator
was missing from F-expressions.
2012-08-14 16:07:32 +03:00
Claude Paroz
c2d59e5564 [py3] Fixed admin_views tests
Also changed several occurrences of 'request' to 'response'.
2012-08-14 14:45:28 +02:00
Aymeric Augustin
0c198b85a3 [py3] Replace filter/lambda by list comprehensions
This is more idiomatic and avoids returning a list on Python 2 and
an iterator on Python 3.
2012-08-14 14:31:06 +02:00
Aymeric Augustin
9299dc42ed [py3] Removed unnecessary calls to .keys()
when computing the length of a dictionary. This fails on Python 3.
2012-08-14 14:09:23 +02:00
Aymeric Augustin
2ae58b20ec [py3] Fixed egg template loader. 2012-08-14 12:29:53 +02:00
Aymeric Augustin
faf570df18 [py3] Compared response.content with bytes. 2012-08-14 12:29:53 +02:00
Claude Paroz
d1452f6097 [py3] Favoured unicode strings in assert(Not)Contains
In Python 3, HTMLParser does not support bytestrings.
2012-08-14 12:19:17 +02:00
Aymeric Augustin
e04230e2e4 [py3] Ported django.http according to PEP 3333.
Perfomed some style cleanup while I was in the area.
2012-08-14 10:32:16 +02:00
Claude Paroz
0df0cf70d4 Reverted pickle-json replacement form_hmac calculation
This reverts commit b109ff8062f4bb225181ec462d69c9dd79339567 and
complement test cases. The change was too hasty, as some form
values cannot be json-serialized as is.
2012-08-14 09:51:39 +02:00
Claude Paroz
363dbd920e [py3] Fixed contrib.formtools tests 2012-08-13 21:26:12 +02:00
Claude Paroz
a025b75f6c [py3] Fixed iterlists usage in QueryDict 2012-08-13 21:25:27 +02:00
Claude Paroz
b109ff8062 Replaced pickle by json in form_hmac calculation
Refs #18340
2012-08-13 21:02:18 +02:00
Claude Paroz
0dac73ebd7 Removed binary flag to open files for writing text content 2012-08-13 18:23:26 +02:00
Claude Paroz
45baaabafb [py3] Fixed encoding issues in cache key generation 2012-08-13 12:56:59 +02:00
Claude Paroz
d774ad752d [py3] Made csrf context processor return Unicode 2012-08-13 11:54:21 +02:00
Claude Paroz
5e958b958b [py3] Avoided comparison with None value in formsets 2012-08-13 11:54:13 +02:00
Claude Paroz
a06503d09b [py3] Fixed content encoding in test client
Thanks Andrews Medina for the initial patch.
2012-08-13 09:56:14 +02:00
Anssi Kääriäinen
1930b899bd Refix #13844 -- Made FloatField aggregates work on Python 2.6 + Postgres
Fixed a regression introduced in 59a655988ee95e4b4e4646cebea88b620d8fcdd2.
2012-08-13 09:15:20 +03:00
Claude Paroz
8a1f439d3a [py3] Fix encoding issues in contrib.sessions 2012-08-12 22:49:10 +02:00
Claude Paroz
ac37c9e495 [py3] Encoded value before feeding it to hashlib.md5 2012-08-12 22:49:10 +02:00
Andrei Antoukh
99321e30ce Fixed #18306 -- Made deferred models issue update_fields on save
Deferred models now automatically update only the fields which are
loaded from the db (with .only() or .defer()). In addition, any field
set manually after the load is updated on save.
2012-08-12 22:39:27 +03:00
Anssi Kääriäinen
59a655988e Fixed #13844 -- Avoid converting unknown db values to float
This patch removes an unconditional float(value) conversion from db
backend default convert_values() method. This can cause problems when
aggregating over character fields for example. In addition, Oracle
and SQLite already return the bare value from their convert_values().

In the long term the converting should be done by fields, and the
fields should then call database backend specific converters when
needed. The current setup is inflexible for 3rd party fields.

Thanks to Merlijn van Deen for the original patch.
2012-08-12 21:52:52 +03:00
Claude Paroz
5513480fe1 [py3] Always convert values from sqlite3 to unicode strings
Thanks Aymeric Augustin for the review.
2012-08-12 20:47:18 +02:00
Claude Paroz
dce34dc969 [py3] Made __repr__ return str with Python 3 2012-08-12 20:45:39 +02:00
Anssi Kääriäinen
c1684e3dcb Fixed #18731 -- Cleaned up split_exclude's use of can_reuse
The outer query's set of reusable joins (can_reuse) was passed to the
inner query's add_filter call. This was incorrect.
2012-08-12 21:40:22 +03:00
Aymeric Augustin
4e68e86153 [py3] Deprecated StrAndUnicode.
This mix-in is superseded by the @python_2_unicode_compatible decorator.
2012-08-12 14:44:41 +02:00
Aymeric Augustin
d4a0b27838 [py3] Refactored __unicode__ to __str__.
* Renamed the __unicode__ methods
* Applied the python_2_unicode_compatible decorator
* Removed the StrAndUnicode mix-in that is superseded by
  python_2_unicode_compatible
* Kept the __unicode__ methods in classes that specifically
  test it under Python 2
2012-08-12 14:44:40 +02:00
Aymeric Augustin
79d62a7175 [py3] Added fixer for python_2_unicode_compatible.
This doesn't deal with classes that define both __unicode__ and
__str__; the definition of __str__ should be removed first. It
doesn't guarantee that __str__ will return a str (rather than bytes)
under Python 3 either.
2012-08-12 14:44:40 +02:00
Aymeric Augustin
a0a0203a39 [py3] Added python_2_unicode_compatible decorator. 2012-08-12 14:44:40 +02:00
Aymeric Augustin
e7e08fd48b [py3] Replaced some __str__ methods by __unicode__
These methods actually return unicode.
2012-08-12 14:44:40 +02:00
Aymeric Augustin
2bb2eecb63 [py3] Removed redundant __str__ methods.
These classes already have an identical __unicode__ method, which
will be used after an upcoming refactoring.
2012-08-12 14:44:40 +02:00
Aymeric Augustin
dbb63e56ea [py3] Avoided returning bytes in Model.__str__
on Python 3.
2012-08-12 14:44:40 +02:00
Karen Tracey
759ae3c2da Fixed #18739 -- witdthratio behavior on None args
Made behavior given None consistent with how non-numerics were handled.
Thanks to ja.geb@me.com for the report.
2012-08-11 19:24:18 -04:00
Claude Paroz
15fffcc751 [py3] Fixed reraising of exceptions
reraise with second argument to None is not supported.
2012-08-11 23:46:23 +02:00
Claude Paroz
900816464d [py3] Re-decoded string after idna encoding 2012-08-11 23:23:31 +02:00
Claude Paroz
7d0f883192 [py3] Fixed JSON deserialization 2012-08-11 23:23:31 +02:00
Karen Tracey
b82eb10b26 Fixed #18754 -- cache keys created by post_process
Corrected to always generate the cache keys from file names with
forward slashes, not backslashes.
2012-08-11 17:05:26 -04:00
Claude Paroz
09c589810d [py3] Used smart_str to prevent regressions in http handling 2012-08-11 15:29:29 +02:00
Claude Paroz
f10a1b0641 [py3] Fixed Python 3 compatibility of http handling
* Using str() when Python 2 expects bytes and Python 3 Unicode
* Fixed reraise-ing syntax
* Fixed slicing of byte strings
2012-08-11 14:47:44 +02:00
Claude Paroz
22527a821b [py3] Fixed str_prefix test utility 2012-08-11 14:22:28 +02:00
Andrews Medina
87e0a75c03 [py3] Decoded base64-encoded hash in contrib.auth.hashers 2012-08-11 00:20:59 +02:00
Claude Paroz
92b2dec918 [py3] Made signing infrastructure pass tests with Python 3 2012-08-10 18:07:46 +02:00
Claude Paroz
751774c29f [py3] Fixed mail tests with Python 3 2012-08-09 20:13:29 +02:00
Alex Gaynor
5f8da527ab [py3k] use the base64 module, instead of bytes.encode('base64') 2012-08-09 07:26:11 -07:00
Aymeric Augustin
5c09c59bc7 [py3] Renamed next to __next__ in iterators.
See PEP 3114. `next` is retained as an alias for Python 2.
2012-08-09 14:36:05 +02:00
Claude Paroz
96a6912ec5 [py3] Fixed compilemessages tests 2012-08-08 23:40:20 +02:00
Claude Paroz
180b672a65 [py3] Fixed Python 3 compatibility in localflavor forms 2012-08-08 23:22:27 +02:00