db.models.DateTimeField

class DateTimeField(auto_now=False, auto_now_add=False, **options) [source] A date and time, represented in Python by a datetime.datetime instance. Takes the same extra arguments as DateField. The default form widget for this field is a single TextInput. The admin uses two separate TextInput widgets with JavaScript shortcuts.

test.Response.resolver_match

resolver_match An instance of ResolverMatch for the response. You can use the func attribute, for example, to verify the view that served the response: # my_view here is a function based view self.assertEqual(response.resolver_match.func, my_view) # class-based views need to be compared by name, as the functions # generated by as_view() won't be equal self.assertEqual(response.resolver_match.func.__name__, MyView.as_view().__name__) If the given URL is not found, accessing this attribute w

core.files.File.chunks()

chunks(chunk_size=None) [source] Iterate over the file yielding “chunks” of a given size. chunk_size defaults to 64 KB. This is especially useful with very large files since it allows them to be streamed off disk and avoids storing the whole file in memory.

auth.forms.UserCreationForm

class UserCreationForm A ModelForm for creating a new user. It has three fields: username (from the user model), password1, and password2. It verifies that password1 and password2 match, validates the password using validate_password(), and sets the user’s password using set_password().

utils.translation.activate()

activate(language) [source] Fetches the translation object for a given language and activates it as the current translation object for the current thread.

views.generic.dates.BaseDateListView

class BaseDateListView [source] A base class that provides common behavior for all date-based views. There won’t normally be a reason to instantiate BaseDateListView; instantiate one of the subclasses instead. While this view (and its subclasses) are executing, self.object_list will contain the list of objects that the view is operating upon, and self.date_list will contain the list of dates for which data is available. Mixins DateMixin MultipleObjectMixin Methods and Attributes allow_emp

postgres.forms.IntegerRangeField

class IntegerRangeField [source] Based on IntegerField and translates its input into NumericRange. Default for IntegerRangeField and BigIntegerRangeField.

db.models.Field.unique

Field.unique If True, this field must be unique throughout the table. This is enforced at the database level and by model validation. If you try to save a model with a duplicate value in a unique field, a django.db.IntegrityError will be raised by the model’s save() method. This option is valid on all field types except ManyToManyField, OneToOneField, and FileField. Note that when unique is True, you don’t need to specify db_index, because unique implies the creation of an index.

forms.Form.add_error()

Form.add_error(field, error) This method allows adding errors to specific fields from within the Form.clean() method, or from outside the form altogether; for instance from a view. The field argument is the name of the field to which the errors should be added. If its value is None the error will be treated as a non-field error as returned by Form.non_field_errors(). The error argument can be a simple string, or preferably an instance of ValidationError. See Raising ValidationError for best

db.models.Model.refresh_from_db()

Model.refresh_from_db(using=None, fields=None) [source] If you need to reload a model’s values from the database, you can use the refresh_from_db() method. When this method is called without arguments the following is done: All non-deferred fields of the model are updated to the values currently present in the database. The previously loaded related instances for which the relation’s value is no longer valid are removed from the reloaded instance. For example, if you have a foreign key from