Commit Graph

7926 Commits

Author SHA1 Message Date
Aymeric Augustin 723c9a8c6d [py3] Ported the 'shell' management command.
The user module and the execfile function were removed in Python 3.

Thanks Linovia for the report.
2012-08-29 23:44:12 +02:00
Claude Paroz 4e70ad11d2 Made FileSystemStorage accept both text and byte streams
Thanks Alexey Boriskin for his help on the patch.
2012-08-29 16:37:37 +02:00
Claude Paroz 361d6738f8 Fixed #11739 -- Made ContentFile support Unicode input 2012-08-29 11:21:33 +02:00
Claude Paroz ebc773ada3 Replaced many smart_bytes by force_bytes
In all those occurrences, we didn't care about preserving the
lazy status of the strings, but we really wanted to obtain a
real bytestring.
2012-08-29 11:20:32 +02:00
Florian Apolloner 3afb5916b2 Fixed #18091 -- Non-ASCII templates break `django-admin.py startproject --template=TEMPLATE`.
Thanks to Claude Huchet and Tomáš Ehrlich for the patch.
2012-08-28 23:23:07 +02:00
Aymeric Augustin 20012b961e [py3] Updated bundled version of six 2012-08-28 23:20:55 +02:00
Mitar b2ffa2ea90 Code comment fix. 2012-08-26 14:28:44 -07:00
Ramiro Morales 5a9e127efc Made model instance history admin view link not hard-coded. Refs #15294. 2012-08-26 17:54:49 -03:00
Aymeric Augustin 28ea4d4b07 Fixed #18852 -- Restored backwards compatibility
in django.core.signing. Specifically, kept the same return types
(str/unicode) under Python 2. Related to [92b2dec918].
2012-08-25 22:22:32 +02:00
Claude Paroz 62e1c5a441 Fixed #17448 -- Improved test and documented raw-sql gis query 2012-08-25 14:39:52 +02:00
Anssi Kääriäinen 01b9c3d519 Fixed #16715 -- Fixed join promotion logic for nested nullable FKs
The joins for nested nullable foreign keys were often created as INNER
when they should have been OUTER joins. The reason was that only the
first join in the chain was promoted correctly. There were also issues
with select_related etc.

The basic structure for this problem was:
  A -[nullable]-> B -[nonnull]-> C

And the basic problem was that the A->B join was correctly LOUTER,
the B->C join not.

The major change taken in this patch is that now if we promote a join
A->B, we will automatically promote joins B->X for all X in the query.
Also, we now make sure there aren't ever join chains like:
   a LOUTER b INNER c
If the a -> b needs to be LOUTER, then the INNER at the end of the
chain will cancel the LOUTER join and we have a broken query.

Sebastian reported this problem and did also major portions of the
patch.
2012-08-25 14:14:45 +03:00
Claude Paroz d7a2e816a1 Added a GeoDjango test with a raw query (Refs #17448)
Thanks David Eklund for the initial patch.
2012-08-25 11:12:43 +02:00
Alex Gaynor b7c3b044fc Cleaned up the implementation of in_bulk 2012-08-24 16:08:16 -07:00
Claude Paroz f5ea730dac Fixed #18843 -- Replaced more special chars in column names (inspectdb)
Thanks airstrike for the report.
2012-08-23 22:59:45 +02:00
Claude Paroz 395c6083af Fixed #12460 -- Improved inspectdb handling of special field names
Thanks mihail lukin for the report and elijahr and kgibula for their
work on the patch.
2012-08-23 21:46:57 +02:00
Claude Paroz 44c09de555 Fixed #18678 -- HttpResponse init arguments allowed for subclasses
Thanks hp1337@gmail.com for the report.
2012-08-23 10:59:22 +02:00
Aymeric Augustin 03671ad7e3 Reordered imports
to avoid an error introduced in 5301a9d7b1.
2012-08-23 10:24:50 +02:00
Aymeric Augustin 5301a9d7b1 [py3] Removed duplicate imports.
Fixed #18837. Refs #18791.
2012-08-23 10:16:16 +02:00
Claude Paroz 7cfe8e8fce Fixed #11340 -- Prevented HttpResponseNotModified to have content/content-type
The HTTP 1.1 spec tells that the 304 response MUST NOT contain a
message body.
Thanks aparajita for the report.
2012-08-22 20:55:24 +02:00
Claude Paroz e2b4eddc11 Used the decorator syntax for properties in django.http 2012-08-22 20:55:24 +02:00
Simon Meers dfe63a52ef Revert "Fixed #18063 -- Avoid unicode in Model.__repr__ in python 2"
This reverts commit 3fce0d2a91.
2012-08-22 11:48:47 +10:00
Claude Paroz 4353a6163c Fixed #18196 -- Improved loaddata error messages. 2012-08-21 21:52:25 +02:00
Anssi Kääriäinen a193372753 Fixed #17886 -- Fixed join promotion in ORed nullable queries
The ORM generated a query with INNER JOIN instead of LEFT OUTER JOIN
in a somewhat complicated case. The main issue was that there was a
chain of nullable FK -> non-nullble FK, and the join promotion logic
didn't see the need to promote the non-nullable FK even if the
previous nullable FK was already promoted to LOUTER JOIN. This resulted
in a query like a LOUTER b INNER c, which incorrectly prunes results.
2012-08-21 21:23:57 +03:00
Claude Paroz fd58d6c258 Merge walk and find_files in makemessages command 2012-08-21 14:43:37 +02:00
Claude Paroz ab2f65bb7f Removed obsolete __members__ definitions
This was useful for pre-Python 2.6 support. See commit c6e8e5d9.
2012-08-21 11:20:22 +02:00
Aymeric Augustin e89bc39935 Reverted type check added in 62954ba04c.
Refs #17040.
2012-08-21 09:00:55 +02:00
Aymeric Augustin 62954ba04c [py3] Fixed #17040 -- ported django.utils.crypto.constant_time_compare.
This is a private API; adding a type check is acceptable.
2012-08-20 22:50:49 +02:00
Aymeric Augustin 54899d810d [py3] Fixed #18805 -- ported createsuperuser.
Thanks sunsesh at gmail.com for the report.
2012-08-20 22:25:41 +02:00
Claude Paroz bfc380baea [py3] Prepared MySQL backend for Python 3 compatibility 2012-08-20 10:46:21 +02:00
Simon Meers 3fce0d2a91 Fixed #18063 -- Avoid unicode in Model.__repr__ in python 2
Thanks guettli and mrmachine.
2012-08-20 16:47:30 +10:00
Anssi Kääriäinen 4db38cbfe1 [py3] Fixed Oracle specific failures 2012-08-19 23:45:26 +03:00
Aymeric Augustin 2f59e94a41 Fixed #18728 -- Made colon optional in tzinfo
Made two-digit hours and minutes mandatory in tzinfo (the code used
to crash if a one-digit representation was provided).

Added standalone tests for django.utils.dateparse.
2012-08-19 21:47:41 +02:00
Aymeric Augustin a43ecc0444 Removed an inaccurate statement
in docstrings of dateparse functions.
2012-08-19 21:25:41 +02:00
Aymeric Augustin 5f2d9cdbb1 [py3] Fixed another regression from 2892cb0ec4. 2012-08-19 18:24:50 +02:00
Aymeric Augustin 2892cb0ec4 [py3] Fixed regression introduced in 536b030363.
Refs #18764.

Reverted 536b030363 and switched to a more explicit way of avoiding
calling bytes(<int>).

This definitely deserves a refactoring. Specifically, _get_content
should just return b''.join(self). Unfortunately that's impossible
with the current tests.
2012-08-19 17:56:46 +02:00
Aymeric Augustin 536b030363 [py3] Supported integers in HttpResponse
Fixed #18764.
2012-08-19 16:38:21 +02:00
Julien Phalip 675431dfaa Fixed #17278 -- Enabled the spatialite GIS tests to run without having to specify a database name in the settings. Thanks to Aymeric for the report and to Ramiro for the initial patch. 2012-08-19 02:17:45 -07:00
Karen Tracey e99293250e [py3] Fixed slow path through file_move_safe
This path is taken on Windows.
2012-08-18 15:44:09 -04:00
Andrew Godwin 1758bf76e4 Merge pull request #287 from uruz/ticket18791
Fixed #18791: [py3] Double import of six in django.forms.widgets
2012-08-18 09:45:16 -07:00
Andrew Godwin bf12c663d9 Merge pull request #289 from mjtamlyn/slugify-real-function
Fixed bug in 212b982 -- Removed duplicate code in removetags
2012-08-18 09:41:06 -07:00
Andrew Godwin 5b09fc8ad2 Merge pull request #288 from mjtamlyn/date-list-period
Fixed #3542 -- Add support for changing granularity on ArchiveView.
2012-08-18 09:10:52 -07:00
Marc Tamlyn e4984812cd Fixed bug in 212b982 -- Removed duplicate code in removetags 2012-08-18 17:09:37 +01:00
Marc Tamlyn 8d5c11caad Fixed #3542 -- Add support for changing granularity on ArchiveView.
Resolving the concept from a very old ticket in a more class-based-view
manner.
2012-08-18 17:03:57 +01:00
Aymeric Augustin afc1bd7ab8 [py3] Made 212b9826bd Python 3-friendly 2012-08-18 17:51:16 +02:00
Alexey Boriskin abc4038b0b Fixed #18791: [py3] Double import of six in django.forms.widgets 2012-08-18 19:17:42 +04:00
Aymeric Augustin de3ad8bb2d [py3] Avoided passing a lazy string to urlparse.
This causes an exception under Python 3.

Fixed #18776.
2012-08-18 16:38:49 +02:00
Aymeric Augustin a120fac65a Introduced force_bytes and force_str.
This is consistent with the smart_* series of functions and it's going
to be used by the next commit.
2012-08-18 16:38:49 +02:00
Marc Tamlyn f04bb6d798 Fixed #17228 -- params context variable is inconsistent
Remove the params variable from the context and just put the variables
in directly.

This had not been committed previously as the original pattern was used
in the functional generic views and we wanted consistency between them,
but django.views.generic.simple.direct_to_template is now gone so we can
do it 'right'.
2012-08-18 15:07:21 +01:00
Marc Tamlyn 212b9826bd Fixed #14516 -- Extract methods from removetags and slugify template filters
Patch by @jphalip updated to apply, documentation and release notes
added.

I've documented strip_tags as well as remove_tags as the difference
between the two wouldn't be immediately obvious.
2012-08-18 15:07:21 +01:00
Marc Tamlyn 58683e9c82 Fixed #16744 -- Class based view should have the view object in the context
Updated the most recent patch from @claudep to apply again and updated
the documentation location.
2012-08-18 15:07:21 +01:00