views.generic.dates.DayMixin.get_next_day()

get_next_day(date) [source] Returns a date object containing the next valid day after the date provided. This function can also return None or raise an Http404 exception, depending on the values of allow_empty and allow_future.

gis.gdal.SpatialReference.geographic

geographic Returns True if this spatial reference is geographic (root node is GEOGCS).

gis.gdal.Layer.num_fields

num_fields Returns the number of fields in the layer, i.e the number of fields of data associated with each feature in the layer: >>> layer.num_fields 4

gis.gdal.Field.as_int()

as_int() Returns the value of the field as an integer: >>> city['Population'].as_int() 102121

db.models.functions.datetime.TruncMonth

class TruncMonth(expression, output_field=None, tzinfo=None, **extra) [source] kind = 'month' These are logically equivalent to Trunc('date_field', kind). They truncate all parts of the date up to kind which allows grouping or filtering dates with less precision. expression can have an output_field of either DateField or DateTimeField. Since DateFields don’t have a time component, only Trunc subclasses that deal with date-parts can be used with DateField: >>> from datetime impo

auth.backends.RemoteUserBackend.clean_username()

RemoteUserBackend.clean_username(username) Performs any cleaning on the username (e.g. stripping LDAP DN information) prior to using it to get or create a User object. Returns the cleaned username.

auth.models.PermissionsMixin.has_module_perms()

has_module_perms(package_name) Returns True if the user has any permissions in the given package (the Django app label). If the user is inactive, this method will always return False.

views.debug.SafeExceptionReporterFilter.is_active()

SafeExceptionReporterFilter.is_active(request) [source] Returns True to activate the filtering operated in the other methods. By default the filter is active if DEBUG is False.

Writing your first Django app, part 7

This tutorial begins where Tutorial 6 left off. We’re continuing the Web-poll application and will focus on customizing Django’s automatically-generated admin site that we first explored in Tutorial 2. Customize the admin form By registering the Question model with admin.site.register(Question), Django was able to construct a default form representation. Often, you’ll want to customize how the admin form looks and works. You’ll do this by telling Django the options you want when you register th

gis.db.models.GeoQuerySet.intersection()

GeoQuerySet.intersection(geom) Deprecated since version 1.9: Use the Intersection function instead. Returns the spatial intersection of the geographic field with the given geometry in an intersection attribute on each element of the GeoQuerySet.