admin.InlineModelAdmin.get_max_num()

InlineModelAdmin.get_max_num(request, obj=None, **kwargs) Returns the maximum number of extra inline forms to use. By default, returns the InlineModelAdmin.max_num attribute. Override this method to programmatically determine the maximum number of 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_max_num(self, request, obj=None, **kwargs): max_num = 1

admin.ModelAdmin.history_view()

ModelAdmin.history_view(request, object_id, extra_context=None) [source] Django view for the page that shows the modification history for a given model instance. Unlike the hook-type ModelAdmin methods detailed in the previous section, these five methods are in reality designed to be invoked as Django views from the admin application URL dispatching handler to render the pages that deal with model instances CRUD operations. As a result, completely overriding these methods will significantly

gis.gdal.SpatialReference.projected

projected Returns True if this spatial reference is a projected coordinate system (root node is PROJCS).

db.models.Model.get_FOO_display()

Model.get_FOO_display() For every field that has choices set, the object will have a get_FOO_display() method, where FOO is the name of the field. This method returns the “human-readable” value of the field. For example: from django.db import models class Person(models.Model): SHIRT_SIZES = ( ('S', 'Small'), ('M', 'Medium'), ('L', 'Large'), ) name = models.CharField(max_length=60) shirt_size = models.CharField(max_length=2, choices=SHIRT_SIZES) >&

gis.gdal.DataSource

class DataSource(ds_input, encoding='utf-8') The constructor for DataSource only requires one parameter: the path of the file you want to read. However, OGR also supports a variety of more complex data sources, including databases, that may be accessed by passing a special name string instead of a path. For more information, see the OGR Vector Formats documentation. The name property of a DataSource instance gives the OGR name of the underlying data source that it is using. The optional enco

gis.gdal.GDALBand.statistics()

statistics(refresh=False, approximate=False) New in Django 1.10. Compute statistics on the pixel values of this band. The return value is a tuple with the following structure: (minimum, maximum, mean, standard deviation). If the approximate argument is set to True, the statistics may be computed based on overviews or a subset of image tiles. If the refresh argument is set to True, the statistics will be computed from the data directly, and the cache will be updated with the result. If a pe

Deployment checklist

The Internet is a hostile environment. Before deploying your Django project, you should take some time to review your settings, with security, performance, and operations in mind. Django includes many security features. Some are built-in and always enabled. Others are optional because they aren’t always appropriate, or because they’re inconvenient for development. For example, forcing HTTPS may not be suitable for all websites, and it’s impractical for local development. Performance optimizatio

utils.translation.gettext()

gettext(message) [source] Translates message and returns it in a UTF-8 bytestring

utils.dateparse.parse_duration()

parse_duration(value) [source] Parses a string and returns a datetime.timedelta. Expects data in the format "DD HH:MM:SS.uuuuuu" or as specified by ISO 8601 (e.g. P4DT1H15M20S which is equivalent to 4 1:15:20).

core.files.uploadhandler.FileUploadHandler.new_file()

FileUploadHandler.new_file(field_name, file_name, content_type, content_length, charset, content_type_extra) [source] Callback signaling that a new file upload is starting. This is called before any data has been fed to any upload handlers. field_name is a string name of the file <input> field. file_name is the unicode filename that was provided by the browser. content_type is the MIME type provided by the browser – E.g. 'image/jpeg'. content_length is the length of the image given by