Geographic Sitemaps

KML is an XML language focused on geographic visualization [1]. KMLSitemap and its compressed counterpart KMZSitemap allow you to present geolocated data in a machine-readable format. Example Reference KMLSitemap KMZSitemap Footnotes [1] http://www.opengeospatial.org/standards/kml

db.models.query.QuerySet.db

db The database that will be used if this query is executed now. Note The query parameter to QuerySet exists so that specialized query subclasses such as GeoQuerySet can reconstruct internal query state. The value of the parameter is an opaque representation of that query state and is not part of a public API. To put it simply: if you need to ask, you don’t need to use it.

sites.requests.RequestSite

class requests.RequestSite A class that shares the primary interface of Site (i.e., it has domain and name attributes) but gets its data from a Django HttpRequest object rather than from a database. __init__(request) Sets the name and domain attributes to the value of get_host(). A RequestSite object has a similar interface to a normal Site object, except its __init__() method takes an HttpRequest object. It’s able to deduce the domain and name by looking at the request’s domain. It ha

db.models.Func

class Func(*expressions, **extra) [source] function A class attribute describing the function that will be generated. Specifically, the function will be interpolated as the function placeholder within template. Defaults to None. template A class attribute, as a format string, that describes the SQL that is generated for this function. Defaults to '%(function)s(%(expressions)s)'. If you’re constructing SQL like strftime('%W', 'date') and need a literal % character in the query, quadr

core.files.base.ContentFile

class ContentFile(File) [source] The ContentFile class inherits from File, but unlike File it operates on string content (bytes also supported), rather than an actual file. For example: from __future__ import unicode_literals from django.core.files.base import ContentFile f1 = ContentFile("esta sentencia está en español") f2 = ContentFile(b"these are bytes")

db.models.query.QuerySet.raw()

raw(raw_query, params=None, translations=None) Takes a raw SQL query, executes it, and returns a django.db.models.query.RawQuerySet instance. This RawQuerySet instance can be iterated over just like an normal QuerySet to provide object instances. See the Performing raw SQL queries for more information. Warning raw() always triggers a new query and doesn’t account for previous filtering. As such, it should generally be called from the Manager or from a fresh QuerySet instance.

db.models.query.QuerySet.delete()

delete() Performs an SQL delete query on all rows in the QuerySet and returns the number of objects deleted and a dictionary with the number of deletions per object type. The delete() is applied instantly. You cannot call delete() on a QuerySet that has had a slice taken or can otherwise no longer be filtered. For example, to delete all the entries in a particular blog: >>> b = Blog.objects.get(pk=1) # Delete all the entries belonging to this Blog. >>> Entry.objects.filter

utils.decorators.decorator_from_middleware()

decorator_from_middleware(middleware_class) [source] Given a middleware class, returns a view decorator. This lets you use middleware functionality on a per-view basis. The middleware is created with no params passed. It assumes middleware that’s compatible with the old style of Django 1.9 and earlier (having methods like process_request(), process_exception(), and process_response()).

template.Engine.select_template()

Engine.select_template(self, template_name_list) [source] Like get_template(), except it takes a list of names and returns the first template that was found.

admin.ModelAdmin.get_queryset()

ModelAdmin.get_queryset(request) The get_queryset method on a ModelAdmin returns a QuerySet of all model instances that can be edited by the admin site. One use case for overriding this method is to show objects owned by the logged-in user: class MyModelAdmin(admin.ModelAdmin): def get_queryset(self, request): qs = super(MyModelAdmin, self).get_queryset(request) if request.user.is_superuser: return qs return qs.filter(author=request.user)