summaryrefslogtreecommitdiff
path: root/django/utils/text.py
AgeCommit message (Collapse)Author
2016-11-14Fixed E305 flake8 warnings.Ramin Farajpour Cami
2016-11-14Decorated a few functions.Tim Graham
2016-10-14Refs #19705 -- Changed gzip modification times to 0.Kevin Christopher Henry
This makes gzip output deterministic, which allows ConditionalGetMiddleware to reliably compare ETags on gzipped content (views using the gzip_page() decorator in particular).
2016-09-17Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.Tim Graham
http://bugs.python.org/issue27364
2016-08-24Fixed #26866 -- Added format_lazy functionMattias Loverot
Added format_lazy function to django.utils.text module. Useful when dealing with relative complex lazy string concatenations (e.g. in urls.py when translating urls in regular expressions).
2016-08-04Fixed #27020 -- Used a context manager to close files.Ville Skyttä
2016-04-08Fixed E128 flake8 warnings in django/.Tim Graham
2016-01-25Fixed #26125 -- Fixed E731 flake warnings.userimack
2015-12-12Fixed #20223 -- Added keep_lazy() as a replacement for allow_lazy().Iacopo Spalletti
Thanks to bmispelon and uruz for the initial patch.
2015-07-17Fixed #16501 -- Added an allow_unicode parameter to SlugField.Edward Henderson
Thanks Flavio Curella and Berker Peksag for the initial patch.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-02-04Fixed #24242 -- Improved efficiency of utils.text.compress_sequence()Matthew Somerville
The function no longer flushes zfile after each write as doing so can lead to the gzipped streamed content being larger than the original content; each flush adds a 5/6 byte type 0 block. Removing this means buf.read() may return nothing, so only yield if that has some data. Testing shows without the flush() the buffer is being flushed every 17k or so and compresses the same as if it had been done as a whole string.
2015-01-17Removed utils.text.javascript_quote() per deprecation timeline; refs #21725.Tim Graham
2014-10-30Fixed #23558 -- documented slugify limitationsDavid Hoffman
2014-10-20Fixed #20221 -- Allowed some functions that use mark_safe() to result in ↵Jon Dufresne
SafeText. Thanks Baptiste Mispelon for the report.
2014-05-17Fixed #6668 -- Optimized utils.text wrap functionMarkus Amalthea Magnuson
This fixes a failing test after applying an optimization of the utils.text.wrap function by user SmileyChris.
2014-03-08Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
2014-02-22Deprecated django.utils.text.javascript_quote.Baptiste Mispelon
Refs #21725.
2014-02-15Fixed #21725 -- Fixed JavaScript quoting encoding.MattBlack85
Thanks to nedbatchelder for the report.
2014-02-13Fixed #19496 -- Added truncatechars_html filter.Jeremy
Thanks esevece for the suggestion and Nick Sandford and Martin Warne for the inital work on the patch.
2014-02-06Fixed #21731 -- Made javascript_quote escapes '</'.Vajrasky Kok
2013-12-26Removed a few gratuitous lambdas.Aymeric Augustin
2013-12-22Fixed #21651 -- Remove recapitalize.Marc Tamlyn
It was not used inside Django, is not tested or documented. Consequently remove without deprecation path. Thanks to @vajrasky for bringing it to our attention.
2013-12-12Fixed #21574 -- Handle bytes consistently in utils.text.normalize_newlines.Baptiste Mispelon
All input is now coerced to text before being normalized. This changes nothing under Python 2 but it allows bytes to be passed to the function without a TypeError under Python3 (bytes are assumed to be utf-8 encoded text). Thanks to trac user vajrasky for the report.
2013-12-12Fixed PEP257 violations (single-quoted docstrings) in utils.text.Baptiste Mispelon
2013-12-10Fixed E124 pep8 warnings.Loic Bistuer
2013-12-07Fixed #21573 -- Improved performance of utils.text.normalize_newlines.Vajrasky Kok
2013-11-02Correct flake8 E302 violationsRay Ashman Jr
2013-11-02Fixed #21302 -- Fixed unused imports and import *.Tim Graham
2013-10-23Fixed #21298 -- Fixed E301 pep8 warningsAlasdair Nicol
2013-10-21Fixed E227 pep8 warningsTim Graham
2013-10-17Fixed #21270 -- Fixed E701 pep8 warningsAlasdair Nicol
2013-10-08Fixed #20568 -- truncatewords_html no longer splits words containing HTML ↵Jaap Roes
entities. Thanks yann0 at hotmail.com for the report.
2013-09-27Fix #21185: Added tests for unescape_entities.Baptiste Mispelon
Also fixed a py3 incompatibility. Thanks to brutasse for the report.
2013-09-02Replaced "not PY3" by "PY2", new in six 1.4.0.Aymeric Augustin
2013-08-30Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette
2013-06-19Removed several unused imports.Aymeric Augustin
2013-04-10Fixed #20231 -- Don't use allow_lazy on smart_splitBaptiste Mispelon
2013-02-13Fixed #19693 -- Made truncatewords_html handle self-closing tagsClaude Paroz
Thanks sneawo for the report and Jonathan Loy for the patch.
2012-12-29Removed truncate_words and truncate_html_words.Aymeric Augustin
2012-10-20Fixed #7581 -- Added streaming responses.Aymeric Augustin
Thanks mrmachine and everyone else involved on this long-standing ticket.
2012-08-23Reordered importsAymeric Augustin
to avoid an error introduced in 5301a9d7b1.
2012-08-23[py3] Removed duplicate imports.Aymeric Augustin
Fixed #18837. Refs #18791.
2012-08-18[py3] Made 212b9826bd Python 3-friendlyAymeric Augustin
2012-08-18Fixed #14516 -- Extract methods from removetags and slugify template filtersMarc Tamlyn
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-15Fix changes introduced in fd04e7 so they don't break on Python 3.Ramiro Morales
2012-08-15Added import of force_unicode to utils/text.pyAdrian Holovaty
For backwards compatibility with stupid people like me. Refs #18772.
2012-08-14[py3] Fixed admin_views testsClaude Paroz
Also changed several occurrences of 'request' to 'response'.
2012-08-07[py3] Ported django.utils.encoding.Aymeric Augustin
* Renamed smart_unicode to smart_text (but kept the old name under Python 2 for backwards compatibility). * Renamed smart_str to smart_bytes. * Re-introduced smart_str as an alias for smart_text under Python 3 and smart_bytes under Python 2 (which is backwards compatible). Thus smart_str always returns a str objects. * Used the new smart_str in a few places where both Python 2 and 3 want a str.
2012-07-22[py3] Switched to Python 3-compatible imports.Aymeric Augustin
xrange/range will be dealt with in a separate commit due to the huge number of changes.