test.runner.DiscoverRunner.teardown_test_environment()

DiscoverRunner.teardown_test_environment(**kwargs) Restores the pre-test environment.

forms.TimeField.input_formats

input_formats A list of formats used to attempt to convert a string to a valid datetime.time object. If no input_formats argument is provided, the default input formats are: '%H:%M:%S', # '14:30:59' '%H:%M', # '14:30'

gis.gdal.SpatialReference.srid

srid Returns the SRID of top-level authority, or None if undefined.

gis.db.models.Extent

class Extent(geo_field) Availability: PostGIS, Oracle, SpatiaLite Returns the extent of all geo_field in the QuerySet as a four-tuple, comprising the lower left coordinate and the upper right coordinate. Example: >>> qs = City.objects.filter(name__in=('Houston', 'Dallas')).aggregate(Extent('poly')) >>> print(qs['poly__extent']) (-96.8016128540039, 29.7633724212646, -95.3631439208984, 32.782058715820)

gis.gdal.Polygon.shell

shell Returns the shell or exterior ring of this polygon, as a LinearRing geometry.

forms.BoundField.help_text

BoundField.help_text The help_text of the field.

Outputting CSV with Django

This document explains how to output CSV (Comma Separated Values) dynamically using Django views. To do this, you can either use the Python CSV library or the Django template system. Using the Python CSV library Python comes with a CSV library, csv. The key to using it with Django is that the csv module’s CSV-creation capability acts on file-like objects, and Django’s HttpResponse objects are file-like objects. Here’s an example: import csv from django.http import HttpResponse def some_view(re

db.models.Field.unique_for_year

Field.unique_for_year Like unique_for_date and unique_for_month.

gis.geos.GEOSGeometry.contains()

GEOSGeometry.contains(other) Returns True if other.within(this) returns True.

gis.geos.GEOSGeometry.length

GEOSGeometry.length Returns the length of this geometry (e.g., 0 for a Point, the length of a LineString, or the circumference of a Polygon).