views.generic.edit.ModelFormMixin.get_form_kwargs()

get_form_kwargs() Add the current instance (self.object) to the standard get_form_kwargs().

db.models.ManyToManyField.swappable

ManyToManyField.swappable Controls the migration framework’s reaction if this ManyToManyField is pointing at a swappable model. If it is True - the default - then if the ManyToManyField is pointing at a model which matches the current value of settings.AUTH_USER_MODEL (or another swappable model setting) the relationship will be stored in the migration using a reference to the setting, not to the model directly. You only want to override this to be False if you are sure your model should alw

auth.mixins.AccessMixin.raise_exception

raise_exception If this attribute is set to True, a PermissionDenied exception will be raised instead of the redirect. Defaults to False.

Unicode data

Django natively supports Unicode data everywhere. Providing your database can somehow store the data, you can safely pass around Unicode strings to templates, models and the database. This document tells you what you need to know if you’re writing applications that use data or templates that are encoded in something other than ASCII. Creating the database Make sure your database is configured to be able to store arbitrary string data. Normally, this means giving it an encoding of UTF-8 or UTF-1

middleware.http.ConditionalGetMiddleware

class ConditionalGetMiddleware [source] Handles conditional GET operations. If the response has a ETag or Last-Modified header, and the request has If-None-Match or If-Modified-Since, the response is replaced by an HttpResponseNotModified. Also sets the Date and Content-Length response-headers.

utils.timezone.now()

now() [source] Returns a datetime that represents the current point in time. Exactly what’s returned depends on the value of USE_TZ: If USE_TZ is False, this will be a naive datetime (i.e. a datetime without an associated timezone) that represents the current time in the system’s local timezone. If USE_TZ is True, this will be an aware datetime representing the current time in UTC. Note that now() will always return times in UTC regardless of the value of TIME_ZONE; you can use localtime() t

db.models.query.QuerySet

class QuerySet(model=None, query=None, using=None) [source] Usually when you’ll interact with a QuerySet you’ll use it by chaining filters. To make this work, most QuerySet methods return new querysets. These methods are covered in detail later in this section. The QuerySet class has two public attributes you can use for introspection: ordered True if the QuerySet is ordered — i.e. has an order_by() clause or a default ordering on the model. False otherwise. db The database that wil

gis.geoip.GeoIP.region_by_name()

GeoIP.region_by_name(query)

db.models.functions.Least

class Least(*expressions, **extra) [source] New in Django 1.9. Accepts a list of at least two field names or expressions and returns the least value. Each argument must be of a similar type, so mixing text and numbers will result in a database error. Warning The behavior of Least when one or more expression may be null varies between databases: PostgreSQL: Least will return the smallest non-null expression, or null if all expressions are null. SQLite, Oracle, and MySQL: If any expression

db.models.BooleanField

class BooleanField(**options) [source] A true/false field. The default form widget for this field is a CheckboxInput. If you need to accept null values then use NullBooleanField instead. The default value of BooleanField is None when Field.default isn’t defined.