utils.feedgenerator.SyndicationFeed.root_attributes()

root_attributes() [source] Return extra attributes to place on the root (i.e. feed/channel) element. Called from write().

utils.feedgenerator.SyndicationFeed.write()

write(outfile, encoding) [source] Outputs the feed in the given encoding to outfile, which is a file-like object. Subclasses should override this.

utils.feedgenerator.SyndicationFeed.writeString()

writeString(encoding) [source] Returns the feed in the given encoding as a string.

utils.feedgenerator.SyndicationFeed.__init__()

__init__(title, link, description, language=None, author_email=None, author_name=None, author_link=None, subtitle=None, categories=None, feed_url=None, feed_copyright=None, feed_guid=None, ttl=None, **kwargs) [source] Initialize the feed with the given dictionary of metadata, which applies to the entire feed. Any extra keyword arguments you pass to __init__ will be stored in self.feed. All parameters should be Unicode objects, except categories, which should be a sequence of Unicode objects.

utils.functional.allow_lazy()

allow_lazy(func, *resultclasses) [source] Deprecated since version 1.10. Works like keep_lazy() except that it can’t be used as a decorator.

utils.functional.cached_property

class cached_property(object, name) [source] The @cached_property decorator caches the result of a method with a single self argument as a property. The cached result will persist as long as the instance does, so if the instance is passed around and the function subsequently invoked, the cached result will be returned. Consider a typical case, where a view might need to call a model’s method to perform some computation, before placing the model instance into the context, where the template m

utils.functional.keep_lazy()

keep_lazy(func, *resultclasses) [source] New in Django 1.10. Django offers many utility functions (particularly in django.utils) that take a string as their first argument and do something to that string. These functions are used by template filters as well as directly in other code. If you write your own similar functions and deal with translations, you’ll face the problem of what to do when the first argument is a lazy translation object. You don’t want to convert it to a string immediat

utils.functional.keep_lazy_text()

keep_lazy_text(func) [source] New in Django 1.10. A shortcut for keep_lazy(six.text_type)(func). If you have a function that returns text and you want to be able to take lazy arguments while delaying their evaluation, simply use this decorator: from django.utils import six from django.utils.functional import keep_lazy, keep_lazy_text # Our previous example was: @keep_lazy(six.text_type) def fancy_utility_function(s, ...): ... # Which can be rewritten as: @keep_lazy_text def fancy_uti

utils.html.conditional_escape()

conditional_escape(text) [source] Similar to escape(), except that it doesn’t operate on pre-escaped strings, so it will not double escape.

utils.html.escape()

escape(text) [source] Returns the given text with ampersands, quotes and angle brackets encoded for use in HTML. The input is first passed through force_text() and the output has mark_safe() applied.