gis.gdal.OGRGeometry.geom_type

geom_type Returns the type of this geometry, as an OGRGeomType object.

gis.gdal.GDALBand.data()

data(data=None, offset=None, size=None, shape=None) New in Django 1.9. The accessor to the pixel values of the GDALBand. Returns the complete data array if no parameters are provided. A subset of the pixel array can be requested by specifying an offset and block size as tuples. If NumPy is available, the data is returned as NumPy array. For performance reasons, it is highly recommended to use NumPy. Data is written to the GDALBand if the data parameter is provided. The input can be of one

forms.MultiWidget.decompress()

decompress(value) [source] This method takes a single “compressed” value from the field and returns a list of “decompressed” values. The input value can be assumed valid, but not necessarily non-empty. This method must be implemented by the subclass, and since the value may be empty, the implementation must be defensive. The rationale behind “decompression” is that it is necessary to “split” the combined value of the form field into the values for each widget. An example of this is how Split

gis.db.models.GeoQuerySet.length()

GeoQuerySet.length(**kwargs) Deprecated since version 1.9: Use the Length function instead. Returns the length of the geometry field in a length attribute (a Distance object) on each model in the queryset.

utils.http.http_date()

http_date(epoch_seconds=None) [source] Formats the time to match the RFC 1123 date format as specified by HTTP RFC 7231#section-7.1.1.1. Accepts a floating point number expressed in seconds since the epoch in UTC–such as that outputted by time.time(). If set to None, defaults to the current time. Outputs a string in the format Wdy, DD Mon YYYY HH:MM:SS GMT.

db.models.Expression.get_source_expressions()

get_source_expressions() Returns an ordered list of inner expressions. For example: >>> Sum(F('foo')).get_source_expressions() [F('foo')]

sessions.backends.base.SessionBase.set_expiry()

set_expiry(value) Sets the expiration time for the session. You can pass a number of different values: If value is an integer, the session will expire after that many seconds of inactivity. For example, calling request.session.set_expiry(300) would make the session expire in 5 minutes. If value is a datetime or timedelta object, the session will expire at that specific date/time. Note that datetime and timedelta values are only serializable if you are using the PickleSerializer. If value is

Testing in Django

Automated testing is an extremely useful bug-killing tool for the modern Web developer. You can use a collection of tests – a test suite – to solve, or avoid, a number of problems: When you’re writing new code, you can use tests to validate your code works as expected. When you’re refactoring or modifying old code, you can use tests to ensure your changes haven’t affected your application’s behavior unexpectedly. Testing a Web application is a complex task, because a Web application is made o

admin.ModelAdmin.list_display_links

ModelAdmin.list_display_links Use list_display_links to control if and which fields in list_display should be linked to the “change” page for an object. By default, the change list page will link the first column – the first field specified in list_display – to the change page for each item. But list_display_links lets you change this: Set it to None to get no links at all. Set it to a list or tuple of fields (in the same format as list_display) whose columns you want converted to links. Y

db.models.Aggregate

class Aggregate(expression, output_field=None, **extra) [source] template A class attribute, as a format string, that describes the SQL that is generated for this aggregate. Defaults to '%(function)s( %(expressions)s )'. function A class attribute describing the aggregate function that will be generated. Specifically, the function will be interpolated as the function placeholder within template. Defaults to None. The expression argument can be the name of a field on the model, or