views.generic.edit.UpdateView.template_name_suffix

template_name_suffix The UpdateView page displayed to a GET request uses a template_name_suffix of '_form'. For example, changing this attribute to '_update_form' for a view updating objects for the example Author model would cause the default template_name to be 'myapp/author_update_form.html'.

gis.geos.Point

class Point(x=None, y=None, z=None, srid=None) Point objects are instantiated using arguments that represent the component coordinates of the point or with a single sequence coordinates. For example, the following are equivalent: >>> pnt = Point(5, 23) >>> pnt = Point([5, 23]) Empty Point objects may be instantiated by passing no arguments or an empty sequence. The following are equivalent: >>> pnt = Point() >>> pnt = Point([]) Changed in Django 1.10: I

“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

gis.geos.GEOSGeometry.valid_reason

GEOSGeometry.valid_reason Returns a string describing the reason why a geometry is invalid.

forms.ModelChoiceField

class ModelChoiceField(**kwargs) [source] Default widget: Select Empty value: None Normalizes to: A model instance. Validates that the given id exists in the queryset. Error message keys: required, invalid_choice Allows the selection of a single model object, suitable for representing a foreign key. Note that the default widget for ModelChoiceField becomes impractical when the number of entries increases. You should avoid using it for more than 100 items. A single argument is required:

test.Client.login()

login(**credentials) [source] If your site uses Django’s authentication system and you deal with logging in users, you can use the test client’s login() method to simulate the effect of a user logging into the site. After you call this method, the test client will have all the cookies and session data required to pass any login-based tests that may form part of a view. The format of the credentials argument depends on which authentication backend you’re using (which is configured by your AUT

views.generic.edit.DeleteView

class django.views.generic.edit.DeleteView A view that displays a confirmation page and deletes an existing object. The given object will only be deleted if the request method is POST. If this view is fetched via GET, it will display a confirmation page that should contain a form that POSTs to the same URL. Ancestors (MRO) This view inherits methods and attributes from the following views: django.views.generic.detail.SingleObjectTemplateResponseMixin django.views.generic.base.TemplateRespons

template.loaders.cached.Loader

class cached.Loader By default, the templating system will read and compile your templates every time they need to be rendered. While the Django templating system is quite fast, the overhead from reading and compiling templates can add up. The cached template loader is a class-based loader that you configure with a list of other loaders that it should wrap. The wrapped loaders are used to locate unknown templates when they are first encountered. The cached loader then stores the compiled Tem

db.models.Field.help_text

Field.help_text Extra “help” text to be displayed with the form widget. It’s useful for documentation even if your field isn’t used on a form. Note that this value is not HTML-escaped in automatically-generated forms. This lets you include HTML in help_text if you so desire. For example: help_text="Please use the following format: <em>YYYY-MM-DD</em>." Alternatively you can use plain text and django.utils.html.escape() to escape any HTML special characters. Ensure that you escap

core.files.storage._open()

_open(name, mode='rb') Required. Called by Storage.open(), this is the actual mechanism the storage class uses to open the file. This must return a File object, though in most cases, you’ll want to return some subclass here that implements logic specific to the backend storage system.