db.models.Value

class Value(value, output_field=None) [source] A Value() object represents the smallest possible component of an expression: a simple value. When you need to represent the value of an integer, boolean, or string within an expression, you can wrap that value within a Value(). You will rarely need to use Value() directly. When you write the expression F('field') + 1, Django implicitly wraps the 1 in a Value(), allowing simple values to be used in more complex expressions. You will need to use

postgres.fields.ArrayField.size

size This is an optional argument. If passed, the array will have a maximum size as specified. This will be passed to the database, although PostgreSQL at present does not enforce the restriction.

sitemaps.views.index()

views.index(request, sitemaps, template_name='sitemap_index.xml', content_type='application/xml', sitemap_url_name='django.contrib.sitemaps.views.sitemap') The sitemap framework also has the ability to create a sitemap index that references individual sitemap files, one per each section defined in your sitemaps dictionary. The only differences in usage are: You use two views in your URLconf: django.contrib.sitemaps.views.index() and django.contrib.sitemaps.views.sitemap(). The django.contrib

db.models.query.QuerySet.dates()

dates(field, kind, order='ASC') Returns a QuerySet that evaluates to a list of datetime.date objects representing all available dates of a particular kind within the contents of the QuerySet. field should be the name of a DateField of your model. kind should be either "year", "month" or "day". Each datetime.date object in the result list is “truncated” to the given type. "year" returns a list of all distinct year values for the field. "month" returns a list of all distinct year/month value

template.Context.pop()

Context.pop()

utils.timezone.localtime()

localtime(value, timezone=None) [source] Converts an aware datetime to a different time zone, by default the current time zone. This function doesn’t work on naive datetimes; use make_aware() instead.

auth.hashers.check_password()

check_password(password, encoded) [source] If you’d like to manually authenticate a user by comparing a plain-text password to the hashed password in the database, use the convenience function check_password(). It takes two arguments: the plain-text password to check, and the full value of a user’s password field in the database to check against, and returns True if they match, False otherwise.

Integrating Django with a legacy database

While Django is best suited for developing new applications, it’s quite possible to integrate it into legacy databases. Django includes a couple of utilities to automate as much of this process as possible. This document assumes you know the Django basics, as covered in the tutorial. Once you’ve got Django set up, you’ll follow this general process to integrate with an existing database. Give Django your database parameters You’ll need to tell Django what your database connection parameters are

template.base.Origin

class Origin [source] name The path to the template as returned by the template loader. For loaders that read from the file system, this is the full path to the template. If the template is instantiated directly rather than through a template loader, this is a string value of <unknown_source>. template_name The relative path to the template as passed into the template loader. If the template is instantiated directly rather than through a template loader, this is None.

admin.AdminSite.register()

AdminSite.register(model_or_iterable, admin_class=None, **options) [source] Registers the given model class (or iterable of classes) with the given admin_class. admin_class defaults to ModelAdmin (the default admin options). If keyword arguments are given – e.g. list_display – they’ll be applied as options to the admin class. Raises ImproperlyConfigured if a model is abstract. and django.contrib.admin.sites.AlreadyRegistered if a model is already registered.