summaryrefslogtreecommitdiff
path: root/django/utils/functional.py
AgeCommit message (Collapse)Author
2013-02-23Fixed #19872Tomek Paczkowski
Made cached_property to behave as property when accessed via class.
2013-01-30Fixed #19160 -- Made lazy plural translations usable.Aymeric Augustin
Many thanks to Alexey Boriskin, Claude Paroz and Julien Phalip.
2012-12-15Fixed a couple of docstring typos.Ramiro Morales
2012-10-26Properly support pickling of LazyObjects in Python 3.3Ian Clelland
2012-08-21Removed obsolete __members__ definitionsClaude Paroz
This was useful for pre-Python 2.6 support. See commit c6e8e5d9.
2012-08-07[py3] Ported django.utils.functional.Aymeric Augustin
2012-08-07[py3] Fixed access to dict keys/values/items.Aymeric Augustin
2012-08-04Fixed a mistake in function documentation 'django.utils.functional.partition'Tim Graham
Thanks Raman Barkholenka for the patch.
2012-07-22[py3] Replaced unicode/str by six.text_type/bytes.Aymeric Augustin
2012-05-18Got rid of old __cmp__methods replaced by rich comparison.Claude Paroz
The __cmp__ methods are unsupported in Python 3. _doctest.py has been left untouched because it is likely it will not be migrated to Python 3.
2012-05-07Fixed total_ordering for Python < 2.7.2Anssi Kääriäinen
The total_ordering in Python versions prior to 2.7.2 is buggy, and this caused infinite recursion for Field comparisons on those versions. Use the borrowed total_ordering for all Python versions prior to 2.7.2. The buggy total_ordering was introduced in commit 5cbfb48b92cb26a335f9c8c0f79d3390290103e2
2012-05-07Made model fields comparable to other objectsSimon Charette
Fixed #17851 -- Added __lt__ and @total_ordering to models.Field, made sure these work correctly on other objects than Field, too.
2012-01-08Try to save memory and time when using lazy objects by refering to their ↵Alex Gaynor
function via the closure, and not making it an attribute on each instance. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17360 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-15Fixed #16563 - Error pickling request.userLuke Plant
Thanks to zero.fuxor for the report git-svn-id: http://code.djangoproject.com/svn/django/trunk@17202 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-21move an mport out of a functionAlex Gaynor
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17020 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-30Fixed #14270 - related manager classes should be cachedLuke Plant
Thanks to Alex Gaynor for the report and initial patch, and mrmachine for more work on it. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16916 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-09Fixed #7596. Added Model.objects.bulk_create, and make use of it in several ↵Alex Gaynor
places. This provides a performance benefit when inserting multiple objects. THanks to Russ for the review, and Simon Meers for the MySQl implementation. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-01Allow SimpleLazyObjects to return None without constantly being reevaluated, ↵Alex Gaynor
also proxy ``__nonzero__``, and do some codecleanup as well. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16308 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-01Fixed #9200 -- Added new form wizard to formtools based on class based ↵Jannis Leidel
views. Many thanks to Stephan Jäkel, ddurham and ElliottM for their work. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16307 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-31Cleaned up how ``request.user`` is set, this is a follow up to [16297]. ↵Alex Gaynor
Thanks for the review Luke. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16305 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-05Fixed #15811 - lazy() doesn't take into account methods defined in parentsLuke Plant
Thanks to abki for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16157 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-01Replaced old-style with new-style decorator syntax.Jannis Leidel
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02Fixed grammar error in utils/functional.py from [15940]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-31Fixed #15724 -- Added update_wrapper import to utils.functional to be a bit ↵Jannis Leidel
more forgiving for 3rd party apps using that import. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15965 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28Remove a license that no long applies to any code, and add a comment for the ↵Alex Gaynor
next person who wants to do some gardening. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15940 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28Removed a bunch more Python 2.4 workarounds now that we don't support that ↵Adrian Holovaty
version. Refs #15702 -- thanks to jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-04Fixed #12164 -- Removed the Python 2.3 compatibility imports and ↵Russell Keith-Magee
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-04-19Fixed #13370 -- Corrected the handling of pickling for lazy() proxy objects. ↵Russell Keith-Magee
Thanks to Alex Gaynor for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13000 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-27Fixed #12769, #12924 -- Corrected the pickling of curried and lazy objects, ↵Russell Keith-Magee
which was preventing queries with translated or related fields from being pickled. And lo, Alex Gaynor didst slayeth the dragon. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12866 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-05Fixed #12506 - 'lazy' fails when there are multiple expected classes with ↵Luke Plant
the same method Thanks to Alex for report and patch git-svn-id: http://code.djangoproject.com/svn/django/trunk@12104 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-17Fixed #11753 - Q objects with callables no longer explode on Python 2.4. ↵Jacob Kaplan-Moss
Thanks, Jeremy Dunck. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11901 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-12FIxed #10130: you may now delete attributes on `settings`. Thanks, jcassee.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11824 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-20Fixed #12060 - equality tests between User and SimpleLazyObject-wrapped User ↵Luke Plant
failed. Also added more tests for SimpleLazyObject Thanks to ericholscher for report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11637 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-19Fixed non-standard introspection support in LazyObject.Luke Plant
LazyObject called a public method ``get_all_members`` on wrapped objects in order to allow introspection. This could easily cause name clashes with existing methods on wrapped objects, and so has been changed to use the standard methods. This could be slightly backwards-incompatible, in obscure cases, if the undocumented LazyObject has been used externally. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11636 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-19Fixed #12049 - LazyObject-wrapped User breaks queries in template tagsLuke Plant
Thanks to chipx86 for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11634 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-15Fixed a regression on Python 2.6 caused by r11623Luke Plant
This might fix #12037, but I cannot reproduce that bug. Refs #12037 git-svn-id: http://code.djangoproject.com/svn/django/trunk@11625 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02Factor out some common pieces of django.conf.LazySettings.Malcolm Tredinnick
This is in preparation for some reuse elsewhere in the core code. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9945 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-28Put back [8120] along with a small tweak. Fixed #6217.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8127 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-28Back out [8120] for a bit. Refs #6217. It's having unintended side-effects ↵Malcolm Tredinnick
(a.k.a breaks the tree) git-svn-id: http://code.djangoproject.com/svn/django/trunk@8126 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27Fixed #6217 -- Reduced the memory used by each ugettext_lazy() call.Malcolm Tredinnick
Thanks to Jakub Wilk for analysis and the initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8120 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-25Fixed #5701 -- Fixed decorators to take the name, attributes, and docstring ↵Gary Wilson Jr
of the function they decorate by adding a modified version of the `functools.wraps` function from Python 2.5. `wraps` has been altered to work with Django's `curry` function and with Python 2.3, which doesn't allow assignment of a function's `__name__` attribute. This fixes severaly annoyances, such as the online documentation for template filters served by the admin app. This change is backwards incompatible if, for some reason, you were relying on the name of a Django decorator instead of the function it decorates. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7153 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-21Fixed #5560 -- Improved the way we create __str__ and __unicode__ methods inMalcolm Tredinnick
lazy() objects. This fixes things for Jython and makes the code more readable, even for CPython. Thanks, Leo Soto. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6587 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15Made a small optimization to __deepcopy__ in [6276].Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6279 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15Fixed #5487 -- Added deepcopying ability to lazy() objects, along with a ↵Malcolm Tredinnick
test to demonstrate why the previous code failed. Debugging and patch from John Buchanan. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6276 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-08Fixed reverse URL lookup using functions when the original URL pattern was aMalcolm Tredinnick
string. This is now just as fragile as it was prior to [5609], but works in a few cases that people were relying on, apparently. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5632 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04Merged Unicode branch into trunk (r4952:5608). This should be fullyMalcolm Tredinnick
backwards compatible for all practical purposes. Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-23Fixed #4566 -- Added caching speed-ups to reverse URL matching. Based on aMalcolm Tredinnick
patch from smoo.master@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5516 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-26Fixed #4040 -- Changed uses of has_key() to "in". Slight performanceMalcolm Tredinnick
improvement and forward-compatible with future Python releases. Patch from Gary Wilson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-07Renamed 'func' argument in django.utils.functional.curry to reduce ↵Adrian Holovaty
possibility that it will clash with a keyword argument name. Thanks for pointing this out, Michael Spencer git-svn-id: http://code.djangoproject.com/svn/django/trunk@3735 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-07Optimized django.utils.functional.curry. Thanks for the patch, Martin GlueckAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3733 bcc190cf-cafb-0310-a4f2-bffc1f526a37