gis.admin.GeoModelAdmin.extra_js

extra_js Sequence of URLs to any extra JavaScript to include.

postgres.search.TrigramDistance

class TrigramDistance(expression, string, **extra) [source] New in Django 1.10. Accepts a field name or expression, and a string or expression. Returns the trigram distance between the two arguments. Usage example: >>> from django.contrib.postgres.search import TrigramDistance >>> Author.objects.create(name='Katy Stevens') >>> Author.objects.create(name='Stephen Keats') >>> test = 'Katie Stephens' >>> Author.objects.annotate( ... distance=Tr

views.generic.detail.SingleObjectTemplateResponseMixin.get_template_names()

get_template_names() Returns a list of candidate template names. Returns the following list: the value of template_name on the view (if provided) the contents of the template_name_field field on the object instance that the view is operating upon (if available) <app_label>/<model_name><template_name_suffix>.html

auth.password_validation.password_changed()

password_changed(password, user=None, password_validators=None) [source] Informs all validators that the password has been changed. This can be used by validators such as one that prevents password reuse. This should be called once the password has been successfully changed. For subclasses of AbstractBaseUser, the password field will be marked as “dirty” when calling set_password() which triggers a call to password_changed() after the user is saved.

core.serializers.get_serializer()

django.core.serializers.get_serializer(format) You can also use a serializer object directly: XMLSerializer = serializers.get_serializer("xml") xml_serializer = XMLSerializer() xml_serializer.serialize(queryset) data = xml_serializer.getvalue() This is useful if you want to serialize data directly to a file-like object (which includes an HttpResponse): with open("file.xml", "w") as out: xml_serializer.serialize(SomeModel.objects.all(), stream=out) Note Calling get_serializer() with an

test.Response.templates

templates A list of Template instances used to render the final content, in the order they were rendered. For each template in the list, use template.name to get the template’s file name, if the template was loaded from a file. (The name is a string such as 'admin/index.html'.) Not using Django templates? This attribute is only populated when using the DjangoTemplates backend. If you’re using another template engine, template_name may be a suitable alternative if you only need the name of t

How to install Django

This document will get you up and running with Django. Install Python Being a Python Web framework, Django requires Python. See What Python version can I use with Django? for details. Get the latest version of Python at https://www.python.org/download/ or with your operating system’s package manager. Django on Jython If you use Jython (a Python implementation for the Java platform), you’ll need to follow a few additional steps. See Running Django on Jython for details. Python on Windows If y

views.i18n.JSONCatalog

class JSONCatalog [source] In order to use another client-side library to handle translations, you may want to take advantage of the JSONCatalog view. It’s similar to JavaScriptCatalog but returns a JSON response. See the documentation for JavaScriptCatalog to learn about possible values and use of the domain and packages attributes. The response format is as follows: { "catalog": { # Translations catalog }, "formats": { # Language formats for date, time, etc.

gis.geos.GEOSGeometry.geom_typeid

GEOSGeometry.geom_typeid Returns the GEOS geometry type identification number. The following table shows the value for each geometry type: Geometry ID Point 0 LineString 1 LinearRing 2 Polygon 3 MultiPoint 4 MultiLineString 5 MultiPolygon 6 GeometryCollection 7

db.models.query.QuerySet.values_list()

values_list(*fields, flat=False) This is similar to values() except that instead of returning dictionaries, it returns tuples when iterated over. Each tuple contains the value from the respective field passed into the values_list() call — so the first item is the first field, etc. For example: >>> Entry.objects.values_list('id', 'headline') [(1, 'First entry'), ...] If you only pass in a single field, you can also pass in the flat parameter. If True, this will mean the returned res