db.models.ManyToManyField.through

ManyToManyField.through Django will automatically generate a table to manage many-to-many relationships. However, if you want to manually specify the intermediary table, you can use the through option to specify the Django model that represents the intermediate table that you want to use. The most common use for this option is when you want to associate extra data with a many-to-many relationship. If you don’t specify an explicit through model, there is still an implicit through model class

db.migrations.operations.AddField

class AddField(model_name, name, field, preserve_default=True) [source] Adds a field to a model. model_name is the model’s name, name is the field’s name, and field is an unbound Field instance (the thing you would put in the field declaration in models.py - for example, models.IntegerField(null=True). The preserve_default argument indicates whether the field’s default value is permanent and should be baked into the project state (True), or if it is temporary and just for this migration (Fal

db.models.DurationField

class DurationField(**options) [source] A field for storing periods of time - modeled in Python by timedelta. When used on PostgreSQL, the data type used is an interval and on Oracle the data type is INTERVAL DAY(9) TO SECOND(6). Otherwise a bigint of microseconds is used. Note Arithmetic with DurationField works in most cases. However on all databases other than PostgreSQL, comparing the value of a DurationField to arithmetic on DateTimeField instances will not work as expected.

db.models.expressions.When

class When(condition=None, then=None, **lookups) [source] A When() object is used to encapsulate a condition and its result for use in the conditional expression. Using a When() object is similar to using the filter() method. The condition can be specified using field lookups or Q objects. The result is provided using the then keyword. Some examples: >>> from django.db.models import When, F, Q >>> # String arguments refer to fields; the following two examples are equivalent

gis.db.models.GeoQuerySet.distance()

GeoQuerySet.distance(geom, **kwargs) Deprecated since version 1.9: Use the Distance function instead. This method takes a geometry as a parameter, and attaches a distance attribute to every model in the returned queryset that contains the distance (as a Distance object) to the given geometry. In the following example (taken from the GeoDjango distance tests), the distance from the Tasmanian city of Hobart to every other PointField in the AustraliaCity queryset is calculated: >>> p

gis.db.models.GeoQuerySet.sym_difference()

GeoQuerySet.sym_difference(geom) Deprecated since version 1.9: Use the SymDifference function instead. Returns the symmetric difference of the geographic field with the given geometry in a sym_difference attribute on each element of the GeoQuerySet.

gis.db.models.GeoQuerySet.transform()

GeoQuerySet.transform(srid=4326, **kwargs) Deprecated since version 1.9: Use the Transform function instead. Availability: PostGIS, Oracle, SpatiaLite The transform method transforms the geometry field of a model to the spatial reference system specified by the srid parameter. If no srid is given, then 4326 (WGS84) is used by default. Note Unlike other GeoQuerySet methods, transform stores its output “in-place”. In other words, no new attribute for the transformed geometry is placed on th

gis.geoip.GeoIP.geos()

GeoIP.geos(query) Returns a django.contrib.gis.geos.Point object corresponding to the query.

template.loaders.app_directories.Loader

class app_directories.Loader Loads templates from Django apps on the filesystem. For each app in INSTALLED_APPS, the loader looks for a templates subdirectory. If the directory exists, Django looks for templates in there. This means you can store templates with your individual apps. This also makes it easy to distribute Django apps with default templates. For example, for this setting: INSTALLED_APPS = ['myproject.polls', 'myproject.music'] ...then get_template('foo.html') will look for foo

http.QueryDict.__getitem__()

QueryDict.__getitem__(key) Returns the value for the given key. If the key has more than one value, __getitem__() returns the last value. Raises django.utils.datastructures.MultiValueDictKeyError if the key does not exist. (This is a subclass of Python’s standard KeyError, so you can stick to catching KeyError.)