class documentation

class SingleObjectMixin(ContextMixin):

Known subclasses: django.views.generic.detail.BaseDetailView, django.views.generic.edit.ModelFormMixin

View In Hierarchy

Provide the ability to retrieve a single object for further manipulation.
Method get​_context​_data Insert the single object into the context dict.
Method get​_context​_object​_name Get the name to use for the object.
Method get​_object Return the object the view is displaying.
Method get​_queryset Return the QuerySet that will be used to look up the object.
Method get​_slug​_field Get the name of a slug field to be used to look up by slug.
Class Variable context​_object​_name Undocumented
Class Variable model Undocumented
Class Variable pk​_url​_kwarg Undocumented
Class Variable query​_pk​_and​_slug Undocumented
Class Variable queryset Undocumented
Class Variable slug​_field Undocumented
Class Variable slug​_url​_kwarg Undocumented

Inherited from ContextMixin:

Class Variable extra​_context Undocumented
def get_context_data(self, **kwargs):
Insert the single object into the context dict.
def get_context_object_name(self, obj):
Get the name to use for the object.
def get_object(self, queryset=None):

Return the object the view is displaying.

Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.

def get_queryset(self):

Return the QuerySet that will be used to look up the object.

This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.

def get_slug_field(self):
Get the name of a slug field to be used to look up by slug.
context_object_name =

Undocumented

model =

Undocumented

pk_url_kwarg: str =

Undocumented

query_pk_and_slug: bool =

Undocumented

queryset =

Undocumented

slug_field: str =

Undocumented

slug_url_kwarg: str =

Undocumented