views.generic.detail.SingleObjectTemplateResponseMixin.template_name_suffix

template_name_suffix The suffix to append to the auto-generated candidate template name. Default suffix is _detail.

Class-based views mixins

Class-based views API reference. For introductory material, see Using mixins with class-based views. Simple mixins Single object mixins Multiple object mixins Editing mixins Date-based mixins

forms.Form.non_field_errors()

Form.non_field_errors() This method returns the list of errors from Form.errors that aren’t associated with a particular field. This includes ValidationErrors that are raised in Form.clean() and errors added using Form.add_error(None, "...").

postgres.aggregates.ArrayAgg

class ArrayAgg(expression, **extra) [source] Returns a list of values, including nulls, concatenated into an array.

postgres.validators.KeysValidator

class KeysValidator(keys, strict=False, messages=None) [source] Validates that the given keys are contained in the value. If strict is True, then it also checks that there are no other keys present. The messages passed should be a dict containing the keys missing_keys and/or extra_keys. Note Note that this checks only for the existence of a given key, not that the value of a key is non-empty.

Porting to Python 3

Django 1.5 is the first version of Django to support Python 3. The same code runs both on Python 2 (≥ 2.6.5) and Python 3 (≥ 3.2), thanks to the six compatibility layer. This document is primarily targeted at authors of pluggable applications who want to support both Python 2 and 3. It also describes guidelines that apply to Django’s code. Philosophy This document assumes that you are familiar with the changes between Python 2 and Python 3. If you aren’t, read Python’s official porting guide fi

db.backends.base.schema.BaseDatabaseSchemaEditor.create_model()

BaseDatabaseSchemaEditor.create_model(model) [source] Creates a new table in the database for the provided model, along with any unique constraints or indexes it requires.

apps.apps.get_app_config()

apps.get_app_config(app_label) Returns an AppConfig for the application with the given app_label. Raises LookupError if no such application exists.

Introduction to class-based views

Class-based views provide an alternative way to implement views as Python objects instead of functions. They do not replace function-based views, but have certain differences and advantages when compared to function-based views: Organization of code related to specific HTTP methods (GET, POST, etc.) can be addressed by separate methods instead of conditional branching. Object oriented techniques such as mixins (multiple inheritance) can be used to factor code into reusable components. The rel

gis.gdal.OGRGeometry.srs

srs This property controls the spatial reference for this geometry, or None if no spatial reference system has been assigned to it. If assigned, accessing this property returns a SpatialReference object. It may be set with another SpatialReference object, or any input that SpatialReference accepts. Example: >>> city.geom.srs.name 'GCS_WGS_1984'