db.models.Manager

class Manager [source] A Manager is the interface through which database query operations are provided to Django models. At least one Manager exists for every model in a Django application. The way Manager classes work is documented in Making queries; this document specifically touches on model options that customize Manager behavior.

apps.AppConfig.get_models()

AppConfig.get_models() [source] Returns an iterable of Model classes for this application.

test.runner.DiscoverRunner.teardown_databases()

DiscoverRunner.teardown_databases(old_config, **kwargs) Destroys the test databases, restoring pre-test conditions. old_config is a data structure defining the changes in the database configuration that need to be reversed. It is the return value of the setup_databases() method.

gis.geos.GEOSGeometry.equals()

GEOSGeometry.equals(other) Returns True if the DE-9IM intersection matrix for the two geometries is T*F**FFF*.

db.models.Manager.raw()

Manager.raw(raw_query, params=None, translations=None) This method takes a raw SQL query, executes it, and returns a django.db.models.query.RawQuerySet instance. This RawQuerySet instance can be iterated over just like a normal QuerySet to provide object instances. This is best illustrated with an example. Suppose you have the following model: class Person(models.Model): first_name = models.CharField(...) last_name = models.CharField(...) birth_date = models.DateField(...) You c

db.models.functions.datetime.TruncSecond

class TruncSecond(expression, output_field=None, tzinfo=None, **extra) [source] kind = 'second' These are logically equivalent to Trunc('datetime_field', kind). They truncate all parts of the date up to kind and allow grouping or filtering datetimes with less precision. expression must have an output_field of DateTimeField. Usage example: >>> from datetime import date, datetime >>> from django.db.models import Count >>> from django.db.models.functions import (

views.generic.list.BaseListView.get()

get(request, *args, **kwargs) Adds object_list to the context. If allow_empty is True then display an empty list. If allow_empty is False then raise a 404 error.

test.SimpleTestCase.client

SimpleTestCase.client Every test case in a django.test.*TestCase instance has access to an instance of a Django test client. This client can be accessed as self.client. This client is recreated for each test, so you don’t have to worry about state (such as cookies) carrying over from one test to another. This means, instead of instantiating a Client in each test: import unittest from django.test import Client class SimpleTest(unittest.TestCase): def test_details(self): client =

views.generic.detail.SingleObjectMixin.get_context_object_name()

get_context_object_name(obj) Return the context variable name that will be used to contain the data that this view is manipulating. If context_object_name is not set, the context name will be constructed from the model_name of the model that the queryset is composed from. For example, the model Article would have context object named 'article'.

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.