core.files.images.ImageFile.width

width Width of the image in pixels.

test.SimpleTestCase.settings()

SimpleTestCase.settings() [source] For testing purposes it’s often useful to change a setting temporarily and revert to the original value after running the testing code. For this use case Django provides a standard Python context manager (see PEP 343) called settings(), which can be used like this: from django.test import TestCase class LoginTestCase(TestCase): def test_login(self): # First check for the default behavior response = self.client.get('/sekrit/')

admin.ModelAdmin.save_as

ModelAdmin.save_as Set save_as to enable a “save as new” feature on admin change forms. Normally, objects have three save options: “Save”, “Save and continue editing”, and “Save and add another”. If save_as is True, “Save and add another” will be replaced by a “Save as new” button that creates a new object (with a new ID) rather than updating the existing object. By default, save_as is set to False.

core.checks.Info

class Info(msg, hint=None, obj=None, id=None) [source]

admin.ModelAdmin.change_list_template

ModelAdmin.change_list_template Path to a custom template, used by changelist_view().

gis.db.models.functions.MakeValid

class MakeValid(expr) New in Django 1.10. Availability: PostGIS Accepts a geographic field or expression and attempts to convert the value into a valid geometry without losing any of the input vertices. Geometries that are already valid are returned without changes. Simple polygons might become a multipolygon and the result might be of lower dimension than the input.

core.validators.int_list_validator()

int_list_validator(sep=', ', message=None, code='invalid', allow_negative=False) [source] New in Django 1.9. Returns a RegexValidator instance that ensures a string consists of integers separated by sep. It allows negative integers when allow_negative is True. Changed in Django 1.10: The allow_negative parameter was added.

postgres.fields.RangeField.range_type

range_type The psycopg2 range type to use.

db.models.Expression.reverse_ordering()

reverse_ordering() Returns self with any modifications required to reverse the sort order within an order_by call. As an example, an expression implementing NULLS LAST would change its value to be NULLS FIRST. Modifications are only required for expressions that implement sort order like OrderBy. This method is called when reverse() is called on a queryset.

db.models.ForeignKey.to_field

ForeignKey.to_field The field on the related object that the relation is to. By default, Django uses the primary key of the related object.