utils.dateparse.parse_duration()

parse_duration(value) [source] Parses a string and returns a datetime.timedelta. Expects data in the format "DD HH:MM:SS.uuuuuu" or as specified by ISO 8601 (e.g. P4DT1H15M20S which is equivalent to 4 1:15:20).

gis.gdal.SpatialReference.semi_major

semi_major Returns the semi major axis of the ellipsoid for this spatial reference.

utils.encoding.force_str()

force_str(s, encoding='utf-8', strings_only=False, errors='strict') Alias of force_bytes() on Python 2 and force_text() on Python 3. This function always returns a str.

db.models.fields.files.FieldFile.save()

FieldFile.save(name, content, save=True) [source] This method takes a filename and file contents and passes them to the storage class for the field, then associates the stored file with the model field. If you want to manually associate file data with FileField instances on your model, the save() method is used to persist that file data. Takes two required arguments: name which is the name of the file, and content which is an object containing the file’s contents. The optional save argument

forms.MultiValueField.require_all_fields

require_all_fields Defaults to True, in which case a required validation error will be raised if no value is supplied for any field. When set to False, the Field.required attribute can be set to False for individual fields to make them optional. If no value is supplied for a required field, an incomplete validation error will be raised. A default incomplete error message can be defined on the MultiValueField subclass, or different messages can be defined on each individual field. For example

db.models.lookups.RegisterLookupMixin

class lookups.RegisterLookupMixin A mixin that implements the lookup API on a class. classmethod register_lookup(lookup, lookup_name=None) Registers a new lookup in the class. For example DateField.register_lookup(YearExact) will register YearExact lookup on DateField. It overrides a lookup that already exists with the same name. lookup_name will be used for this lookup if provided, otherwise lookup.lookup_name will be used. Changed in Django 1.9: The lookup_name parameter was added.

forms.Form.is_multipart()

Form.is_multipart() If you’re writing reusable views or templates, you may not know ahead of time whether your form is a multipart form or not. The is_multipart() method tells you whether the form requires multipart encoding for submission: >>> f = ContactFormWithMugshot() >>> f.is_multipart() True Here’s an example of how you might use this in a template: {% if form.is_multipart %} <form enctype="multipart/form-data" method="post" action="/foo/"> {% else %}

http.HttpRequest.body

HttpRequest.body The raw HTTP request body as a byte string. This is useful for processing data in different ways than conventional HTML forms: binary images, XML payload etc. For processing conventional form data, use HttpRequest.POST. You can also read from an HttpRequest using a file-like interface. See HttpRequest.read().

db.models.Model.validate_unique()

Model.validate_unique(exclude=None) [source] This method is similar to clean_fields(), but validates all uniqueness constraints on your model instead of individual field values. The optional exclude argument allows you to provide a list of field names to exclude from validation. It will raise a ValidationError if any fields fail validation. Note that if you provide an exclude argument to validate_unique(), any unique_together constraint involving one of the fields you provided will not be ch

views.generic.dates.MonthMixin

class MonthMixin [source] A mixin that can be used to retrieve and provide parsing information for a month component of a date. Methods and Attributes month_format The strftime() format to use when parsing the month. By default, this is '%b'. month Optional The value for the month, as a string. By default, set to None, which means the month will be determined using other means. get_month_format() [source] Returns the strftime() format to use when parsing the month. Returns mon