class StackedInline [source] The admin interface has the ability to edit models on the same page as a parent model. These are called inlines. Suppose you have these two models: from django.db import models class Author(models.Model): name = models.CharField(max_length=100) class Book(models.Model): author = models.ForeignKey(Author, on_delete=models.CASCADE) title = models.CharField(max_length=100) You can edit the books authored by an author on the author page. You add inlines t
class django.views.generic.detail.SingleObjectMixin Provides a mechanism for looking up an object associated with the current HTTP request. Methods and Attributes model The model that this view will display data for. Specifying model = Foo is effectively the same as specifying queryset = Foo.objects.all(), where objects stands for Foo’s default manager. queryset A QuerySet that represents the objects. If provided, the value of queryset supersedes the value provided for model. Warni
GEOSGeometry.buffer(width, quadsegs=8) Returns a GEOSGeometry that represents all points whose distance from this geometry is less than or equal to the given width. The optional quadsegs keyword sets the number of segments used to approximate a quarter circle (defaults is 8).
get_ordering() Returns a string (or iterable of strings) that defines the ordering that will be applied to the queryset. Returns ordering by default.
create_superuser(username, email, password, **extra_fields) Same as create_user(), but sets is_staff and is_superuser to True.
get_next_month(date) [source] Returns a date object containing the first day of the month after the date provided. This function can also return None or raise an Http404 exception, depending on the values of allow_empty and allow_future.
class PositiveSmallIntegerField(**options) [source] Like a PositiveIntegerField, but only allows values under a certain (database-dependent) point. Values from 0 to 32767 are safe in all databases supported by Django.
class BoolAnd(expression, **extra) [source] Returns True, if all input values are true, None if all values are null or if there are no values, otherwise False .
description A verbose description of the field, e.g. for the django.contrib.admindocs application. The description can be of the form: description = _("String (up to %(max_length)s)") where the arguments are interpolated from the field’s __dict__. To map a Field to a database-specific type, Django exposes several methods:
is_anonymous Read-only attribute which is always False. This is a way of differentiating User and AnonymousUser objects. Generally, you should prefer using is_authenticated to this attribute. Changed in Django 1.10: In older versions, this was a method. Backwards-compatibility support for using it as a method will be removed in Django 2.0.
Page 166 of 226