Commit Graph

7778 Commits

Author SHA1 Message Date
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 ace9ccfe9f Fixed #18666 -- when upgrading a user's password to a new algorithm only save the password field to the databaes. 2012-07-24 19:03:26 -07:00
Piet Delport 487b92a13c it's -> its 2012-07-25 01:21:15 +02:00
Ramiro Morales f758bdab5e Fixed #18271 -- Changed stage at which TransactionTestCase flushes DB tables.
Previously, the flush was done before the test case execution and now
it is performed after it.

Other changes to the testing infrastructure include:

* TransactionTestCase now doesn't reset autoincrement sequences either
  (previous behavior can achieved by using `reset_sequences`.)
  With this, no implicit such reset is performed by any of the provided
  TestCase classes.

* New ordering of test cases: All unittest tes cases are run first and
  doctests are run at the end.

THse changes could be backward-incompatible with test cases that relied
on some kind of state being preserved between tests. Please read the
relevant sections of the release notes and testing documentation for
further details.

Thanks Andreas Pelme for the initial patch. Karen Tracey and Anssi
Kääriäinen for the feedback and Anssi for reviewing.

This also fixes #12408.
2012-07-24 17:24:16 -03: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
Aymeric Augustin ae4125ffce Removed a Python 3-compatibility hack.
Thanks Preston Holmes for the patch.
2012-07-23 13:48:04 +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 cacd845996 [py3] Fixed remaining Python 3 syntax errors.
django.utils.unittest.* weren't touched -- they're only imported on Python 2.6.
2012-07-22 09:29:53 +02:00
Aymeric Augustin 56dbe924a6 [py3] Removed longs. 2012-07-22 09:29:53 +02:00
Aymeric Augustin f1d5dc81ac [py3] Switched to Python 3-compatible introspection. 2012-07-22 09:29:53 +02:00
Aymeric Augustin d11d45aad9 [py3] Used six.with_metaclass wherever necessary. 2012-07-22 09:29:52 +02:00
Aymeric Augustin 7fa51a24a8 [py3] Exception aren't iterable in Python 3. 2012-07-22 09:29:52 +02:00
Aymeric Augustin d796c94b03 [py3] Used six.reraise wherever necessary. 2012-07-22 09:29:52 +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
Julien Phalip 01c392623d Fixed #10057 -- Ensured that the 'show_delete' context variable in the admin's change view actually controls the display of the delete button. Thanks to rajeesh for the report, to patcoll for the patch, and to David Gouldin for the test. 2012-07-21 18:10:24 -07:00
Ramiro Morales ea667ee3ae Made LiveServerTestCase to restore state on exit.
The piece of state is DB connections' allow_thread_sharing attribute
which gets munged test are run when in-memory SQLite databases.

Thanks Anssi for suggesting the possible root cause and Julien for
implementing the fix.
2012-07-21 20:16:47 -03:00
Julien Phalip 2b6644388f Fixed an `except` statement to be Python3-compatible. Thanks to charettes for the tip. 2012-07-21 15:13:55 -07:00
Aymeric Augustin 4ceb9db9d8 Removed u prefix on a unicode string. 2012-07-21 22:38:25 +02:00
Julien Phalip 1af0271d7c Fixed #6170 -- Ensured that a useful exception is raised when a regex is invalid in the URLConf.
Thanks to abrahamson.j for the report, to guettli for initial work on the patch, and to David Gouldin for the new patch and test.
2012-07-21 13:30:34 -07:00
Claude Paroz 423244bc6b Fixed #4680 -- Improved initial_sql parsing
In particular, allow the '--' sequence to be present in string
values without being interpreted as comment marker.
Thanks Tim Chase for the report and shaleh for the initial patch.
2012-07-21 14:24:29 +02:00
Claude Paroz 32a4df6c55 Fixed #18395 -- Reset language-related global variables with setting_changed 2012-07-21 13:49:07 +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
Aymeric Augustin 5d560dcb98 Fixed #18504 -- Computed |naturalday in local time. 2012-07-19 23:02:22 +02:00
Aymeric Augustin 123362dd37 Fixed #18608 -- Reduced monkey-patching in tests.
Thanks Claude Paroz for the patch.
2012-07-19 20:02:20 +02:00
Claude Paroz c54905b359 Fixed #18479 -- Stopped makemessages raising error on gettext warnings
Thanks Niels Busch for the initial patch.
2012-07-18 20:43:35 +02:00
Aymeric Augustin 1e89a208d0 Fixed #18645 -- Clarified filesizeformat implementation
Thanks Jérôme Renard for the patch.
2012-07-18 15:01:12 +02:00
Claude Paroz 8184aff2b0 Fixed #18547 -- Improved error message when gettext is missing 2012-07-17 22:04:47 +02:00
Claude Paroz 23f94f0741 Fixed #18561 -- Made HttpResponse.tell() support non-ascii chars 2012-07-17 22:00:54 +02:00
Alex Gaynor 110c729309 Merge pull request #215 from mgrouchy/add-interpreter-options
Adds interpreter option to shell command as per ticket #18639
2012-07-17 11:04:59 -07:00
Mike Grouchy f2abfe1e48 Adds interpreter option to shell command as per ticket #18639
Specify python interpreter interface ipython or bpython with the -i,
--interface options
argument.
 ex// python manage.py shell -i bpython
 ex// python manage.py shell --interface bpython

Like all other options, defaults to default python interpreter when your
selected choice isn't available.

updated documentation where appropriate
2012-07-17 13:45:35 -04:00
Vebjorn Ljosa d5012d6371 Fixed #18644 -- Made urlize trim trailing period followed by parenthesis 2012-07-17 12:44:02 -04:00
Alex Gaynor 52df0d50b0 Switched to use a more idiomatic construct. 2012-07-17 07:01:01 -07:00
Anssi Kääriäinen 29132ebdef Fixed #17788 -- Added batch_size argument to qs.bulk_create()
The qs.bulk_create() method did not work with large batches together
with SQLite3. This commit adds a way to split the bulk into smaller
batches. The default batch size is unlimited except for SQLite3 where
the batch size is limited to 999 SQL parameters per batch.

Thanks to everybody who participated in the discussions at Trac.
2012-07-17 15:24:41 +03:00
Anssi Kääriäinen fcad6c48f0 Fixed #17497 -- Corrected FieldError message in add_fields()
The erroneous message was user visible in values_list() calls.

Thanks to ojii for report and review, and to antoviaque for the patch.
2012-07-17 12:49:46 +03:00
Anssi Kääriäinen aeda55e6bf Fixed #3881 -- skip saving session when response status is 500
Saving session data is somewhat likely to lead into error when the
status code is 500. It is guaranteed to lead into error if the reason
for the 500 code is query error on PostgreSQL.
2012-07-16 20:57:55 +03:00
Nuno Maltez bebbbb7af0 Fixed #18056 - Cleared aggregations on DateQuery.add_date_select
Cleared aggregations on add_date_select method so only distinct dates
are returned when dealing with a QuerySet that contained aggregations.
That would cause the query set to return repeated dates because it
would look for distinct (date kind, aggregation) pairs.
2012-07-16 19:52:31 +03:00
Claude Paroz 35ddeee455 Removed debugging line left in previous commit 2012-07-15 21:19:23 +02:00
Claude Paroz cdcdd131da Dropped support for GDAL < 1.5
GDAL 1.5 has been released in December 2007.
2012-07-15 21:10:32 +02: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 9877d25dc6 Switched from usign a method that was about to be deprecated to normal code. 2012-07-14 16:02:30 -07:00
Alex Gaynor 3e8d8bb094 Fixed auth to not use an internal implementation detail of SortedDict 2012-07-14 14:33:13 -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
Alex Gaynor fb8ec2855b Remove some code that has been dead since newforms-admin was merged, many moons ago. 2012-07-12 09:27:08 -07:00
Alex Gaynor 76d5daa60f Changed `manage.py shell`'s help text to reflect that it can invoke bpython. 2012-07-10 14:26:42 -07:00
Claude Paroz 828f7b62e8 Fixed #18602 -- Improved error message when database NAME is missing
Thanks Kristian Glass for the report.
2012-07-10 13:22:55 +02:00
Claude Paroz d9db1d3373 Added supplementary check for CUIT number of ar localflavor
Thanks Kevin Schaul for the initial patch.
2012-07-09 14:10:54 +02:00
Claude Paroz 1d2982362d Fixed #18537 -- Fixed CUIT calculation in ar localflavor
Thanks mmoya at 8ksoft.com.ar for the report and Kevin Shaul for the
initial patch.
2012-07-09 14:10:54 +02:00
Claude Paroz 146aff3bac Fixed #18590 - Reverted Python 2.4 workaround for Model pickling
Revert of 08d521efa0. Refs #10547, #12121.
Thanks Michal Petrucha for the report.
2012-07-08 20:08:28 +02:00
Jannis Leidel 1aa0d8ac4d Fixed #18487 -- Made sure that protocol-relative URLs aren't processed by the cached staticfiles storage. Thanks to LukaszBalcerzak for the patch. 2012-07-08 18:25:12 +02:00
Jannis Leidel 3047981517 Fixed #18050 -- Fixed a rather glaring bug in the handling of @import statements when using the cached staticfiles storage. 2012-07-08 18:17:53 +02:00
Jannis Leidel effc2cad95 Merge branch 'master' of github.com:django/django 2012-07-08 12:57:04 +02:00
Jannis Leidel 3727f6d096 Fixed #18430 -- Use the FILE_CHARSET setting when reading from a file during post processing with the cached staticfiles storage. Thanks to Brant Young for initial debugging. 2012-07-08 12:56:49 +02:00
Julien Phalip 8015593bc1 Fixed #17978 -- Fixed a minor layout issue when an inline contains a filter horizontal widget. Thanks to Aymeric Augustin for the report. 2012-07-07 15:41:04 -07:00
Florian Apolloner a4bb7dd552 Merge branch 'master' of github.com:django/django 2012-07-07 15:49:00 +02:00
Jannis Leidel 0a68a2994b Fixed #18254 -- Added ability to the static template tags to store the result in a contextt variable. Many thanks to Andrei Antoukh for the initial patch. 2012-07-07 15:30:25 +02:00
Florian Apolloner 52a9e15794 Fixed a regression in the user admin page introduced in a92e7f37c4.
a92e7f37c4 switched most of the internal stuff
to format_html. Using format_html in the `render` method of
`ReadOnlyPasswordHashWidget` caused it to generate `SafeString` instances.
Later these safe strings where returned from `BoundField.__unicode__` which
caused force_unicode to loose the "safe" information. This commit fixes that by
ensuring that the render method returns `SafeUnicode` instead of `SafeString`.
2012-07-07 15:29:20 +02:00
Claude Paroz 8dafd04c45 Fixed #17257 - Removed outdated comment in syndication view
Thanks krzysiumed for the patch.
2012-07-07 11:34:04 +02:00
Adrian Holovaty 8855f9380e Merge pull request #176 from benspaulding/ticket_18521
Add reST role to templates named in some view docs.
2012-07-06 12:46:26 -07:00
Guilherme Gondim 91e4f7effb Fix copyright holder 2012-07-06 15:24:07 -03:00
Luke Plant 2ba4278cb3 Fixed #18484 - 'display:none' on CSRF token div is redundant and causes problems with some browsers
Thanks to hedleyroos for the report
2012-07-06 15:33:29 +01:00
Luke Plant 8fdc56d2a6 Fixed #18572 - Python26 string format incompatibility
Thanks to anonymous/AeroNotix for the report
2012-07-06 00:23:02 +01:00
Anssi Kääriäinen d3c2eb103f Fixed #18330 - Made cache culling 3rd party db backend friendly
This is Ian Kelly's patch from #15580 with minor modifications.
2012-07-05 17:20:48 +03:00
Andrei Antoukh 0f49b2bce2 Fixed #18362 - Made model.save() update_fields accept attnames 2012-07-05 16:43:28 +03:00
Luke Plant a222d6e800 Fixed incorrect URL to object on delete confirmation and history page 2012-07-03 22:20:12 +01:00
Luke Plant b0eee0ba4b Removed various unnecessary instances of mark_safe applied to URLs
Also fixed some test breakages introduced in last commit
2012-07-03 22:20:12 +01:00
Luke Plant a92e7f37c4 Changed a lot of internal code to use 'format_html' where appropriate/possible 2012-07-03 22:20:12 +01: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
Anssi Kääriäinen ab7f071058 Fixed comment wording in sql/where.py
Thanks to Simon Charette for noticing this.
2012-07-03 10:31:06 +03:00
Julien Phalip 2cd4cf58d3 Fixed #18550 -- Ensured that the admin history view works with escaped primary keys.
Thanks to josh.oosterman for the report and patch.
2012-07-01 18:40:50 -07:00
Anssi Kääriäinen e74787391e Fixed a regression introduced in where.as_sql() refactor
At least Oracle needs parentheses in negated where conditions, even if
there is only single condition negated. Fixed this by reverting to old
logic in that part of as_sql() and adding a comment about this.

I did not investigate why the parentheses are needed. The original
offending commit was bd283aa844.
2012-07-01 22:52:35 +03:00
Anssi Kääriäinen f572ee0c65 Fixed #16047 -- Restore autocommit state correctly on psycopg2
When the postgresql_psycopg2 backend was used with DB-level autocommit
mode enabled, after entering transaction management and then leaving
it, the isolation level was never set back to autocommit mode.

Thanks brodie for report and working on this issue.
2012-07-01 19:36:43 +03:00
Anssi Kääriäinen da573fbb41 Fixed some locations to work with autocommit=True
- backends: supports_transactions()
 - select_for_update tests
2012-07-01 19:27:36 +03:00
Anssi Kääriäinen bd283aa844 Refactored the empty/full result logic in WhereNode.as_sql()
Made sure the WhereNode.as_sql() handles various EmptyResultSet and
FullResultSet conditions correctly. Also, got rid of the FullResultSet
exception class. It is now represented by '', [] return value in the
as_sql() methods.
2012-07-01 17:21:34 +03:00
Anssi Kääriäinen 2b9fb2e644 Fixed #18251 -- Removed a deadlock possibility in apploading
Thanks to harm for the report and comments.
2012-07-01 16:14:27 +03:00
Claude Paroz da200c5e35 Fixed #16519 -- Deprecated mimetype kwarg of HttpResponse __init__
This keyword was already deprecated in the code (supported for
backwards compatibility only), but never formally deprecated.
Thanks Paul McMillan for the report and yasar11732 for the initial
patch.
2012-06-30 21:27:47 +02:00
Claude Paroz deed192dda Removed usage of mimetype kwarg of HttpResponse
Refs #16519.
2012-06-30 21:19:07 +02:00
Claude Paroz 2c2c8a6326 Isolated sitemaps test from ABSOLUTE_URL_OVERRIDES
Refs #15988.
2012-06-30 18:50:28 +02:00
Claude Paroz db87016b1a Fixed #12493 -- Deprecated auto-correction of TEMPLATE_DIRS 2012-06-30 15:06:42 +02:00
Claude Paroz 47da7b7a9a Fixed #18102 -- Defined min/max_length on French localflavor form fields
Thanks mothsART for the report and the initial patch.
2012-06-30 13:18:07 +02:00
Claude Paroz 26cb227cfe Fixed #15197 -- Fixed yaml serialization into HttpResponse
Thanks fourga38 for the report and hirokiky at gmail.com for the
initial patch.
2012-06-28 16:29:29 +02:00
Ben Spaulding 24dec9edaa Add reST role to templates named in some view docs.
This makes the templates link up correctly in the admindocs.
2012-06-26 21:45:45 -05:00
Josh Smeaton fa182e8ae8 Fixed #18465 -- Set date formats correctly on Oracle
Correctly configure NLS_SESSION_PARAMETERS to format Date and DateTime
on Oracle backend.

Thanks to Josh Smeaton for report & patch.
2012-06-26 19:39:14 +03:00
Claude Paroz 05d333ba3b Fixed #18515 -- Conditionally regenerated filename in FileField validation
When a FileField value has been saved, a new validation should not
regenerate a new filename when checking the length. Refs #9893.
2012-06-26 18:18:44 +02:00
Anssi Kääriäinen b6c356b7bb Fixed #17485 -- Made defer work with select_related
This commit tackles a couple of issues. First, in certain cases there
were some mixups if field.attname or field.name should be deferred.
Field.attname is now always used.

Another issue tackled is a case where field is both deferred by
.only(), and selected by select_related. This case is now an error.

A lot of thanks to koniiiik (Michal Petrucha) for the patch, and
to Andrei Antoukh for review.
2012-06-26 18:08:42 +03:00
Claude Paroz 5318783027 Fixed #17966 -- Isolated ProfileTestCase from custom AUTH_PROFILE_MODULE
Thanks Rob Golding for helping on the patch.
2012-06-25 20:26:17 +02:00
Claude Paroz 4b722b31e1 Fixed #16317 -- Fixed dumpdata for self-referencing models and natural keys
Thanks aldaran for the patch.
2012-06-24 19:54:56 +02:00
Alex Gaynor e0fce8706d Switch to using context managers for acquiring and releasing locks. 2012-06-23 08:11:15 -07:00