views.generic.detail.SingleObjectMixin.pk_url_kwarg
  • References/Python/Django/API/Single object mixins

pk_url_kwarg The name of the URLConf keyword argument that contains the primary key. By default, pk_url_kwarg is

2025-01-10 15:47:30
views.generic.detail.SingleObjectMixin.get_context_object_name()
  • References/Python/Django/API/Single object mixins

get_context_object_name(obj) Return the context variable name that will be used to contain the data that this view is manipulating

2025-01-10 15:47:30
views.generic.detail.SingleObjectMixin.get_object()
  • References/Python/Django/API/Single object mixins

get_object(queryset=None) Returns the single object that this view will display. If queryset is provided, that

2025-01-10 15:47:30
views.generic.detail.SingleObjectMixin.queryset
  • References/Python/Django/API/Single object mixins

queryset A QuerySet that represents the objects. If provided, the value of queryset supersedes the

2025-01-10 15:47:30
views.generic.detail.SingleObjectMixin
  • References/Python/Django/API/Single object mixins

class django.views.generic.detail.SingleObjectMixin Provides a mechanism for looking up an object associated with the current

2025-01-10 15:47:30
views.generic.detail.SingleObjectMixin.model
  • References/Python/Django/API/Single object mixins

model The model that this view will display data for. Specifying model = Foo is effectively the same as specifying

2025-01-10 15:47:30
views.generic.detail.SingleObjectMixin.get_context_data()
  • References/Python/Django/API/Single object mixins

get_context_data(**kwargs) Returns context data for displaying the list of objects. The base

2025-01-10 15:47:30