views.generic.base.RedirectView.get_redirect_url()

get_redirect_url(*args, **kwargs) Constructs the target URL for redirection. The default implementation uses url as a starting string and performs expansion of % named parameters in that string using the named groups captured in the URL. If url is not set, get_redirect_url() tries to reverse the pattern_name using what was captured in the URL (both named and unnamed groups are used). If requested by query_string, it will also append the query string to the generated URL. Subclasses may imple

gis.geos.WKBWriter.write()

write(geom) Returns the WKB of the given geometry as a Python buffer object. Example: >>> from django.contrib.gis.geos import Point, WKBWriter >>> pnt = Point(1, 1) >>> wkb_w = WKBWriter() >>> wkb_w.write(pnt) <read-only buffer for 0x103a898f0, size -1, offset 0 at 0x103a89930>

views.generic.edit.ProcessFormView.post()

post(request, *args, **kwargs) Constructs a form, checks the form for validity, and handles it accordingly.

gis.gdal.SpatialReference.import_xml()

import_xml(xml) Import spatial reference from XML.

gis.gdal.SpatialReference.proj

proj Returns the PROJ.4 representation for this spatial reference.

db.models.Model.save()

Model.save(force_insert=False, force_update=False, using=DEFAULT_DB_ALIAS, update_fields=None) [source] If you want customized saving behavior, you can override this save() method. See Overriding predefined model methods for more details. The model save process also has some subtleties; see the sections below.

test.Client.put()

put(path, data='', content_type='application/octet-stream', follow=False, secure=False, **extra) [source] Makes a PUT request on the provided path and returns a Response object. Useful for testing RESTful interfaces. When data is provided, it is used as the request body, and a Content-Type header is set to content_type. The follow, secure and extra arguments act the same as for Client.get().

db.models.Field.many_to_many

Field.many_to_many Boolean flag that is True if the field has a many-to-many relation; False otherwise. The only field included with Django where this is True is ManyToManyField.

One-to-one relationships

To define a one-to-one relationship, use OneToOneField. In this example, a Place optionally can be a Restaurant: from django.db import models class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) def __str__(self): # __unicode__ on Python 2 return "%s the place" % self.name class Restaurant(models.Model): place = models.OneToOneField( Place, on_delete=models.CASCADE, primary_key

gis.geos.GEOSGeometry.clone()

GEOSGeometry.clone() This method returns a GEOSGeometry that is a clone of the original.