sites.requests.RequestSite.__init__()

__init__(request) Sets the name and domain attributes to the value of get_host().

admin.InlineModelAdmin.get_formset()

InlineModelAdmin.get_formset(request, obj=None, **kwargs) Returns a BaseInlineFormSet class for use in admin add/change views. See the example for ModelAdmin.get_formsets_with_inlines.

template.backends.django.DjangoTemplates

class DjangoTemplates [source] Set BACKEND to 'django.template.backends.django.DjangoTemplates' to configure a Django template engine. When APP_DIRS is True, DjangoTemplates engines look for templates in the templates subdirectory of installed applications. This generic name was kept for backwards-compatibility. DjangoTemplates engines accept the following OPTIONS: 'autoescape': a boolean that controls whether HTML autoescaping is enabled. It defaults to True. Warning Only set it to False

db.models.fields.files.FieldFile.name

FieldFile.name The name of the file including the relative path from the root of the Storage of the associated FileField.

views.decorators.http.etag()

etag(etag_func) [source]

forms.MultiValueField

class MultiValueField(fields=(), **kwargs) [source] Default widget: TextInput Empty value: '' (an empty string) Normalizes to: the type returned by the compress method of the subclass. Validates the given value against each of the fields specified as an argument to the MultiValueField. Error message keys: required, invalid, incomplete Aggregates the logic of multiple fields that together produce a single value. This field is abstract and must be subclassed. In contrast with the single-va

forms.DecimalField

class DecimalField(**kwargs) [source] Default widget: NumberInput when Field.localize is False, else TextInput. Empty value: None Normalizes to: A Python decimal. Validates that the given value is a decimal. Leading and trailing whitespace is ignored. Error message keys: required, invalid, max_value, min_value, max_digits, max_decimal_places, max_whole_digits The max_value and min_value error messages may contain %(limit_value)s, which will be substituted by the appropriate limit. Simila

admin.InlineModelAdmin.raw_id_fields

InlineModelAdmin.raw_id_fields By default, Django’s admin uses a select-box interface (<select>) for fields that are ForeignKey. Sometimes you don’t want to incur the overhead of having to select all the related instances to display in the drop-down. raw_id_fields is a list of fields you would like to change into an Input widget for either a ForeignKey or ManyToManyField: class BookInline(admin.TabularInline): model = Book raw_id_fields = ("pages",)

db.models.BooleanField

class BooleanField(**options) [source] A true/false field. The default form widget for this field is a CheckboxInput. If you need to accept null values then use NullBooleanField instead. The default value of BooleanField is None when Field.default isn’t defined.

Advanced tutorial: How to write reusable apps

This advanced tutorial begins where Tutorial 7 left off. We’ll be turning our Web-poll into a standalone Python package you can reuse in new projects and share with other people. If you haven’t recently completed Tutorials 1–7, we encourage you to review these so that your example project matches the one described below. Reusability matters It’s a lot of work to design, build, test and maintain a web application. Many Python and Django projects share common problems. Wouldn’t it be great if we