redirects.middleware.RedirectFallbackMiddleware

class middleware.RedirectFallbackMiddleware You can change the HttpResponse classes used by the middleware by creating a subclass of RedirectFallbackMiddleware and overriding response_gone_class and/or response_redirect_class. response_gone_class The HttpResponse class used when a Redirect is not found for the requested path or has a blank new_path value. Defaults to HttpResponseGone. response_redirect_class The HttpResponse class that handles the redirect. Defaults to HttpResponseP

sessions.backends.db.SessionStore.create_model_instance()

create_model_instance(data) New in Django 1.9. Returns a new instance of the session model object, which represents the current session state. Overriding this method provides the ability to modify session model data before it’s saved to database.

http.HttpResponse.has_header()

HttpResponse.has_header(header) Returns True or False based on a case-insensitive check for a header with the given name.

views.generic.edit.FormMixin.form_class

form_class The form class to instantiate.

http.HttpRequest

class HttpRequest [source]

test.SimpleTestCase.assertJSONNotEqual()

SimpleTestCase.assertJSONNotEqual(raw, expected_data, msg=None) [source] Asserts that the JSON fragments raw and expected_data are not equal. See assertJSONEqual() for further details. Output in case of error can be customized with the msg argument.

gis.db.models.GeoQuerySet.translate()

GeoQuerySet.translate(x, y, z=0.0, **kwargs) Deprecated since version 1.9: Use the Translate function instead. Availability: PostGIS, SpatiaLite Translates the geometry field to a new location using the given numeric parameters as offsets.

db.models.Field.model

Field.model Returns the model on which the field is defined. If a field is defined on a superclass of a model, model will refer to the superclass, not the class of the instance.

db.models.Field.deconstruct()

deconstruct() [source] Returns a 4-tuple with enough information to recreate the field: The name of the field on the model. The import path of the field (e.g. "django.db.models.IntegerField"). This should be the most portable version, so less specific may be better. A list of positional arguments. A dict of keyword arguments. This method must be added to fields prior to 1.7 to migrate its data using Migrations.

db.models.query.QuerySet.distinct()

distinct(*fields) Returns a new QuerySet that uses SELECT DISTINCT in its SQL query. This eliminates duplicate rows from the query results. By default, a QuerySet will not eliminate duplicate rows. In practice, this is rarely a problem, because simple queries such as Blog.objects.all() don’t introduce the possibility of duplicate result rows. However, if your query spans multiple tables, it’s possible to get duplicate results when a QuerySet is evaluated. That’s when you’d use distinct(). N