djblets.util.compat.django.utils.functional
Backports of functionality from Django 1.11’s django.utils.functional.
Note that this module is not considered API-stable. Changes may be made that
remove or alter functionality in the future. Please use at your own risk.
-
class
LazyObject
[source]
Bases: object
A wrapper for another class that can be used to delay instantiation of the
wrapped class.
By subclassing, you have the opportunity to intercept and alter the
instantiation. If you don’t need to do that, use SimpleLazyObject.
-
__init__
()[source]
x.__init__(…) initializes x; see help(type(x)) for signature
-
__getattr__
(*args)[source]
-
__setattr__
(name, value)[source]
x.__setattr__(‘name’, value) <==> x.name = value
-
__delattr__
(name)[source]
x.__delattr__(‘name’) <==> del x.name
-
__reduce__
()[source]
helper for pickle
-
__getstate__
()[source]
-
__copy__
()[source]
-
__deepcopy__
(memo)[source]
-
__str__
(*args)[source]
-
__unicode__
(*args)[source]
-
__nonzero__
(*args)[source]
-
__dir__
(*args)[source]
-
__class__
[source]
alias of __builtin__.type
-
__eq__
(*args)[source]
-
__ne__
(*args)[source]
-
__hash__
(*args)[source]
-
__getitem__
(*args)[source]
-
__setitem__
(*args)[source]
-
__delitem__
(*args)[source]
-
__iter__
(*args)[source]
-
__len__
(*args)[source]
-
__contains__
(*args)[source]
-
class
SimpleLazyObject
(func)[source]
Bases: django.utils.functional.LazyObject
A lazy object initialized from any function.
Designed for compound objects of unknown type. For builtins or objects of
known type, use django.utils.functional.lazy.
-
__init__
(func)[source]
Pass in a callable that returns the object to be wrapped.
If copies are made of the resulting SimpleLazyObject, which can happen
in various circumstances within Django, then you must ensure that the
callable can be safely run more than once and will return the same
value.
-
__repr__
() <==> repr(x)[source]
-
__copy__
()[source]
-
__deepcopy__
(memo)[source]
-
unpickle_lazyobject
(wrapped)[source]
Used to unpickle lazy objects. Just return its argument, which will be the
wrapped object.