views.generic.dates.BaseTodayArchiveView

class BaseTodayArchiveView [source]

db.models.Transform.output_field

output_field Defines the class this transformation outputs. It must be a Field instance. By default is the same as its lhs.output_field.

contenttypes.models.ContentType.get_object_for_this_type()

ContentType.get_object_for_this_type(**kwargs) Takes a set of valid lookup arguments for the model the ContentType represents, and does a get() lookup on that model, returning the corresponding object.

utils.html.format_html()

format_html(format_string, *args, **kwargs) [source] This is similar to str.format(), except that it is appropriate for building up HTML fragments. All args and kwargs are passed through conditional_escape() before being passed to str.format(). For the case of building up small HTML fragments, this function is to be preferred over string interpolation using % or str.format() directly, because it applies escaping to all arguments - just like the template system applies escaping by default. So

gis.gdal.Feature.index

index A method that returns the index of the given field name. This will be the same for all features in a given layer: >>> city.index('Population') 1

auth.models.AbstractBaseUser.get_session_auth_hash()

get_session_auth_hash() Returns an HMAC of the password field. Used for Session invalidation on password change.

auth.models.User.set_password()

set_password(raw_password) Sets the user’s password to the given raw string, taking care of the password hashing. Doesn’t save the User object. When the raw_password is None, the password will be set to an unusable password, as if set_unusable_password() were used.

Many-to-one relationships

To define a many-to-one relationship, use ForeignKey: from django.db import models class Reporter(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) email = models.EmailField() def __str__(self): # __unicode__ on Python 2 return "%s %s" % (self.first_name, self.last_name) class Article(models.Model): headline = models.CharField(max_length=100) pub_date = models.DateField() reporter = models.

gis.admin.GeoModelAdmin.map_width

map_width Width of the map, in pixels. Defaults to 600.

utils.safestring.SafeUnicode

class SafeUnicode Historical name of SafeText. Only available under Python 2.