gis.gdal.OGRGeometry.geom_count

geom_count Returns the number of elements in this geometry: >>> polygon.geom_count 1

gis.gdal.Layer.spatial_filter

spatial_filter Property that may be used to retrieve or set a spatial filter for this layer. A spatial filter can only be set with an OGRGeometry instance, a 4-tuple extent, or None. When set with something other than None, only features that intersect the filter will be returned when iterating over the layer: >>> print(layer.spatial_filter) None >>> print(len(layer)) 3 >>> [feat.get('Name') for feat in layer] ['Pueblo', 'Lawrence', 'Houston'] >>> ks_exten

“How-to” guides

Here you’ll find short answers to “How do I....?” types of questions. These how-to guides don’t cover topics in depth – you’ll find that material in the Using Django and the API Reference. However, these guides will help you quickly accomplish common tasks. Authentication using REMOTE_USER Writing custom django-admin commands Writing custom model fields Custom Lookups Custom template tags and filters Writing a custom storage system Deploying Django Upgrading Django to a newer version Error rep

db.models.query.QuerySet.only()

only(*fields) The only() method is more or less the opposite of defer(). You call it with the fields that should not be deferred when retrieving a model. If you have a model where almost all the fields need to be deferred, using only() to specify the complementary set of fields can result in simpler code. Suppose you have a model with fields name, age and biography. The following two querysets are the same, in terms of deferred fields: Person.objects.defer("age", "biography") Person.objects.

http.HttpRequest.POST

HttpRequest.POST A dictionary-like object containing all given HTTP POST parameters, providing that the request contains form data. See the QueryDict documentation below. If you need to access raw or non-form data posted in the request, access this through the HttpRequest.body attribute instead. It’s possible that a request can come in via POST with an empty POST dictionary – if, say, a form is requested via the POST HTTP method but does not include form data. Therefore, you shouldn’t use if

http.HttpRequest.method

HttpRequest.method A string representing the HTTP method used in the request. This is guaranteed to be uppercase. Example: if request.method == 'GET': do_something() elif request.method == 'POST': do_something_else()

core.validators.URLValidator

class URLValidator(schemes=None, regex=None, message=None, code=None) [source] A RegexValidator that ensures a value looks like a URL, and raises an error code of 'invalid' if it doesn’t. Loopback addresses and reserved IP spaces are considered valid. Literal IPv6 addresses (RFC 2732) and unicode domains are both supported. In addition to the optional arguments of its parent RegexValidator class, URLValidator accepts an extra optional attribute: schemes URL/URI scheme list to validate aga

admin.ModelAdmin.get_search_results()

ModelAdmin.get_search_results(request, queryset, search_term) [source] The get_search_results method modifies the list of objects displayed into those that match the provided search term. It accepts the request, a queryset that applies the current filters, and the user-provided search term. It returns a tuple containing a queryset modified to implement the search, and a boolean indicating if the results may contain duplicates. The default implementation searches the fields named in ModelAdmi

views.generic.dates.YearMixin.year

year Optional The value for the year, as a string. By default, set to None, which means the year will be determined using other means.

gis.gdal.GDALRaster.height

height The height of the source in pixels (Y-axis). >>> GDALRaster({'width': 10, 'height': 20, 'srid': 4326}).height 20