External packages

Django ships with a variety of extra, optional tools that solve common problems (contrib.*). For easier maintenance and to trim the size of the codebase, a few of those applications have been moved out to separate projects. Localflavor django-localflavor is a collection of utilities for particular countries and cultures. GitHub Documentation PyPI Comments django-contrib-comments can be used to attach comments to any model, so you can use it for comments on blog entries, photos, book chapters,

sessions.backends.base.SessionBase.clear()

clear() It also has these methods:

gis.geos.GEOSGeometry.json

GEOSGeometry.json Returns the GeoJSON representation of the geometry. Note that the result is not a complete GeoJSON structure but only the geometry key content of a GeoJSON structure. See also GeoJSON Serializer.

admin.ModelAdmin.get_readonly_fields()

ModelAdmin.get_readonly_fields(request, obj=None) The get_readonly_fields method is given the HttpRequest and the obj being edited (or None on an add form) and is expected to return a list or tuple of field names that will be displayed as read-only, as described above in the ModelAdmin.readonly_fields section.

http.HttpRequest.get_full_path()

HttpRequest.get_full_path() [source] Returns the path, plus an appended query string, if applicable. Example: "/music/bands/the_beatles/?print=true"

gis.widgets.BaseGeometryWidget.geom_type

BaseGeometryWidget.geom_type The OpenGIS geometry type, generally set by the form field.

auth.models.PermissionsMixin.has_perm()

has_perm(perm, obj=None) Returns True if the user has the specified permission, where perm is in the format "<app label>.<permission codename>" (see permissions). If the user is inactive, this method will always return False. If obj is passed in, this method won’t check for a permission for the model, but for this specific object.

gis.db.models.functions.Distance

class Distance(expr1, expr2, spheroid=None, **extra) Availability: MySQL (≥ 5.6.1), PostGIS, Oracle, SpatiaLite Accepts two geographic fields or expressions and returns the distance between them, as a Distance object. On MySQL, a raw float value is returned, as it’s not possible to automatically determine the unit of the field. On backends that support distance calculation on geodetic coordinates, the proper backend function is automatically chosen depending on the SRID value of the geometri

gis.geos.MultiPolygon

class MultiPolygon(*args, **kwargs) MultiPolygon objects may be instantiated by passing Polygon objects as arguments, or a single sequence of Polygon objects: >>> p1 = Polygon( ((0, 0), (0, 1), (1, 1), (0, 0)) ) >>> p2 = Polygon( ((1, 1), (1, 2), (2, 2), (1, 1)) ) >>> mp = MultiPolygon(p1, p2) >>> mp = MultiPolygon([p1, p2]) Changed in Django 1.10: In previous versions, an empty MultiPolygon couldn’t be instantiated. cascaded_union Deprecated since

core.management.BaseCommand

class BaseCommand [source] The base class from which all management commands ultimately derive. Use this class if you want access to all of the mechanisms which parse the command-line arguments and work out what code to call in response; if you don’t need to change any of that behavior, consider using one of its subclasses. Subclassing the BaseCommand class requires that you implement the handle() method.