Andrew Godwin
7f75460fd6
Fixed #19070 -- urlize filter no longer raises exceptions on 2.7
...
Thanks to claudep for the patch.
2012-10-31 10:58:14 +00:00
Aymeric Augustin
b4420d9602
Fixed #18964 -- floatformat test passes under py3k
...
Thanks Russell for the report.
2012-10-28 19:57:03 +01: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
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
bdca5ea345
[py3] Replaced unicode/str by six.text_type/bytes.
2012-07-22 09:29:54 +02:00
Vebjorn Ljosa
d5012d6371
Fixed #18644 -- Made urlize trim trailing period followed by parenthesis
2012-07-17 12:44:02 -04: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
e2548ec2a9
Fixed #18071 -- Ignored case sensitivity in urlize utility. Thanks luke@creaturecreative.com and adamzap for the report and the patch.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-04-11 17:49:22 +00:00
Claude Paroz
8dd04fd84b
Fixed #15683 -- Prevented escaped string to be needlessly marked safe twice in force_escape filter. Thanks tyrion for the initial patch.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17876 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-04-07 15:16:11 +00:00
Claude Paroz
9383a2761c
Removed with_statement imports, useless in Python >= 2.6. Refs #17965 . Thanks jonash for the patch.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17828 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-30 08:02:08 +00:00
Jannis Leidel
c1acda6d8f
Updated a few localization formats to stop the changes done in r17473 from breaking the tests.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-10 01:13:29 +00:00
Jannis Leidel
e734477bd7
Fixed #17592 -- Handle URLs starting with a dot when using urlize. Thanks, Claude Paroz.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17435 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-04 16:05:48 +00:00
Ramiro Morales
c5dcba4159
Made dictsort and dictsort reversed template filters fail silently
...
when passed list of things that aren't dictionaries.
Thanks Harris Lapiroff for the report and Daniel Barreto for the patch.
Fixes #15652 .
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17374 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-15 02:01:21 +00:00
Aymeric Augustin
62766f4248
Reverted parts of r17359 that could cause false positives in URL detection, especially on file names.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-08 21:36:22 +00:00
Aymeric Augustin
15d10a5210
Fixed #11911 -- Made the urlize filter smarter with closing punctuation.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17362 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-08 19:42:14 +00:00
Aymeric Augustin
05a3ecbf96
Fixed #16656 -- Changed the urlize filter to accept more top-level domains.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17359 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-08 16:08:43 +00:00
Aymeric Augustin
27508918fb
Fixed #16395 -- Prevented urlize from highlighting some malformed URLs. Thanks BernhardEssl for the report and initial patch.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17358 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-08 15:43:32 +00:00
Aymeric Augustin
aa4e152296
Fixed #12183 -- Made the urlize filter insert the nofollow attribute properly when an http: URL occurs after a mailto: URL. Thanks eronen for the report.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17356 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-08 09:51:36 +00:00
Aymeric Augustin
f21a9da485
Fixed #13704 -- Handled IDN properly in the urlize template filter. Thanks Claude Paroz for the initial version of the patch.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17348 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-07 18:39:14 +00:00
Aymeric Augustin
e3a7bfccbb
Fixed #9655 -- Prevented the urlize template filter from double-quoting URLs. Thanks Claude Paroz for writing the tests.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17347 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-07 18:15:28 +00:00
Aymeric Augustin
e5719b203c
Fixed #17496 -- Regression in the floatformat template filter, introduced by the fix for #15789 .
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17335 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-03 13:09:12 +00:00
Aymeric Augustin
27444618f6
Fixed #15789 -- Set the decimal precisio to avoid an exception in the floatformat filter, and added a few more tests. Thanks akaihola for the report, igalarzab for the patch and ptone for the review.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17297 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-30 14:35:29 +00:00
Aymeric Augustin
9b1cb755a2
Added support for time zones. Thanks Luke Plant for the review. Fixed #2626 .
...
For more information on this project, see this thread:
http://groups.google.com/group/django-developers/browse_thread/thread/cf0423bbb85b1bbf
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-18 13:01:06 +00:00
Aymeric Augustin
0a1a9b71fa
Made the defaultfilters tests run on the actual filters, not on functions imported from django.utils.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17054 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-29 15:28:44 +00:00
Alex Gaynor
d362c1546f
Convert much of the regression tests to use absolute imports. There's still work to be done though.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-13 18:51:33 +00:00
Jannis Leidel
343b4f1ea5
Fixed #14288 -- Fixed linebreaksbr template filter to normalize newlines first. Thanks, Julien Phalip.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16573 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-29 10:22:25 +00:00
Jannis Leidel
b0d274dbd5
Added missing future imports missed in r16167.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16169 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-06 19:49:06 +00:00
Jannis Leidel
7dd72360a2
Make use of new translation and settings context manager in the tests.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16167 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-06 13:29:44 +00:00
Ramiro Morales
3ecf628b36
Fixed #11206 -- Ensure that the floatformat template filter doesn't switch to scientific notation when asked to format a zero value with more than six decimal places. Thanks Tai Lee for the report and fix and Facundo Batista for his help when Decimal module expertise was needed.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15736 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03 20:56:46 +00:00
Russell Keith-Magee
3a6491cf56
Fixed #14240 -- Enabled localization for the filesize filter. Thanks to David Danier for the report and patch.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15290 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-24 08:16:09 +00:00
Russell Keith-Magee
d577648732
Migrated defaultfilters doctests. Thanks to Stephan Jaekel.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13937 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-28 08:19:04 +00:00
Luke Plant
3f9054dd77
Fixed #12965 - unordered_list template filter fails when given a non-iterable second item in a two item list
...
Thanks to grahamu for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13845 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-13 22:31:17 +00:00
Russell Keith-Magee
047d161164
Fixed #14002 -- Updated filesize filter to support terabyte and petabyte file sizes. Thanks to Aaron T. Myers for the patch.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13584 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-14 12:45:15 +00:00
Russell Keith-Magee
5211f48ae3
Fixed #12164 -- Removed the Python 2.3 compatibility imports and workarounds. Thanks to timo and claudep for the patch.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13094 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-04 14:00:30 +00:00
Russell Keith-Magee
beca4b8109
Fixed #13114 -- Modified escapejs to produce output that is JSON compliant. Thanks to David Danier for the report.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12780 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-15 07:22:20 +00:00
Russell Keith-Magee
e6740cb39c
Fixed #11944 -- Improved exception handling for the filesizeformat filter. Thanks to rfk for the report and patch.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12426 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-13 14:37:17 +00:00
Malcolm Tredinnick
8931d8d688
Fixed #10675 -- Added unicode paragraph and line-sep handling to escapejs.
...
There were a couple of line breaking Unicode characters (\u2028 and
\u2029) that cause Javascript errors, at least in Firefox, if not
escaped. So now we do so. Based on a patch from rleland.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10543 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-12 04:55:41 +00:00
Jacob Kaplan-Moss
a68c4a85ce
Fixed #10513 : floatformat now works with floatish things, not just real floats. Thanks, Alex.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10278 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-31 18:17:21 +00:00
Karen Tracey
b81bc22ad2
Fixed #5748 -- Made floatformat filter round properly on all platforms and handle NaN input correctly on Windows. Also added tests for these cases. Thanks for the report and initial patch to SmileyChris and PJCrosier.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9369 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-08 01:44:46 +00:00
Malcolm Tredinnick
384c48e456
Cleaned up some tests I broke as a result of the escapejs changes in [8577].
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8599 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 20:51:45 +00:00
Russell Keith-Magee
06d49768bd
Fixed #7743 : Reverted [8483], which was itself a reversion of [8481], after confirmation from Malcolm. Corrected a long standing mistake in the timesince/timeuntil filters when using a parameter for 'now'. Thanks to Andrew Shearer <ashearerw@shearersoftware.com> for the report.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8535 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 12:31:10 +00:00
Russell Keith-Magee
67402a6fb5
Reverted [8481] and [8482] while we work out what is going on with #8453 and the related discussions that I wasn't previously aware of.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 15:03:40 +00:00
Russell Keith-Magee
46da8ac9e5
Fixed #7443 : Corrected a long standing mistake in the timesince/timeuntil filters when using a parameter for 'now'. Thanks to Andrew Shearer <ashearerw@shearersoftware.com> for the report.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8481 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 12:52:04 +00:00
Russell Keith-Magee
32b8c3e1c0
Fixed #7718 -- Added a naive implementation of sorted() for Python 2.3 compatibility, and modified test cases to import the function when required.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7914 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-13 08:48:18 +00:00
Adrian Holovaty
b7fea94096
Fixed #7542 -- Fixed bug in urlize where it was appending 'http://' to the link text. Thanks for the patch and tests, devin
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7755 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 05:07:13 +00:00
Russell Keith-Magee
5da67a084a
Fixed #7355 -- Modified urlize utility to handle https:// addresses. Thanks for the report and patch, clint.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-19 12:05:39 +00:00
Russell Keith-Magee
ed1c21171c
Fixed #7366 -- Modified a few expected test outputs to remove the dependency on dictionary ordering. Thanks for the patch, Leo Soto.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7575 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-06 11:47:47 +00:00
Jacob Kaplan-Moss
b65fce6595
Fixed #4131 : added an "escapejs" filter for use in JavaScript strings, and updated the documentation on addslashes to point to the new ticket. Featuring contributions from Ned Batchelder, Jeremy Dunck, and Andy Durdin.
...
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6892 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-04 21:08:29 +00:00
Malcolm Tredinnick
5d1d054e15
Fixed #6030 -- More robust error handling for the "float" filter. Thanks,
...
SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6752 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29 20:10:00 +00:00
Malcolm Tredinnick
356662cf74
Implemented auto-escaping of variable output in templates. Fully controllable by template authors and it's possible to write filters and templates that simulataneously work in both auto-escaped and non-auto-escaped environments if you need to. Fixed #2359
...
See documentation in templates.txt and templates_python.txt for how everything
works.
Backwards incompatible if you're inserting raw HTML output via template variables.
Based on an original design from Simon Willison and with debugging help from Michael Radziej.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6671 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-14 12:58:53 +00:00