admin.InlineModelAdmin.get_extra()

InlineModelAdmin.get_extra(request, obj=None, **kwargs) Returns the number of extra inline forms to use. By default, returns the InlineModelAdmin.extra attribute. Override this method to programmatically determine the number of extra inline forms. For example, this may be based on the model instance (passed as the keyword argument obj): class BinaryTreeAdmin(admin.TabularInline): model = BinaryTree def get_extra(self, request, obj=None, **kwargs): extra = 2 if obj:

db.models.FilePathField.allow_files

FilePathField.allow_files Optional. Either True or False. Default is True. Specifies whether files in the specified location should be included. Either this or allow_folders must be True.

gis.gdal.GDALRaster.name

name The name of the source which is equivalent to the input file path or the name provided upon instantiation. >>> GDALRaster({'width': 10, 'height': 10, 'name': 'myraster', 'srid': 4326}).name 'myraster'

sessions.backends.base.SessionBase.test_cookie_worked()

test_cookie_worked() Returns either True or False, depending on whether the user’s browser accepted the test cookie. Due to the way cookies work, you’ll have to call set_test_cookie() on a previous, separate page request. See Setting test cookies below for more information.

gis.db.models.functions.NumGeometries

class NumGeometries(expression, **extra) Availability: MySQL, PostGIS, Oracle, SpatiaLite Accepts a single geographic field or expression and returns the number of geometries if the geometry field is a collection (e.g., a GEOMETRYCOLLECTION or MULTI* field); otherwise returns None.

gis.gdal.OGRGeomType.num

num Returns the number corresponding to the OGR geometry type: >>> gt1.num 3

test.SimpleTestCase

class SimpleTestCase [source] A subclass of unittest.TestCase that adds this functionality: Some useful assertions like:Checking that a callable raises a certain exception. Testing form field rendering and error treatment. Testing HTML responses for the presence/lack of a given fragment. Verifying that a template has/hasn't been used to generate a given response content. Verifying a HTTP redirect is performed by the app. Robustly testing two HTML fragments for equality/inequality or containm

admin.models.LogEntry.get_edited_object()

LogEntry.get_edited_object() A shortcut that returns the referenced object.

http.HttpResponse.__init__()

HttpResponse.__init__(content='', content_type=None, status=200, reason=None, charset=None) [source] Instantiates an HttpResponse object with the given page content and content type. content should be an iterator or a string. If it’s an iterator, it should return strings, and those strings will be joined together to form the content of the response. If it is not an iterator or a string, it will be converted to a string when accessed. content_type is the MIME type optionally completed by a ch

views.decorators.http.condition()

condition(etag_func=None, last_modified_func=None) [source]