# Documentation Django 6.0.7

# Vues génériques fondées sur les classes - index général

Cet index présente une autre organisation de la documentation de référence des vues fondées sur les classes. Pour chaque vue, les attributs et méthodes réels de l’arborescence de classe sont représentés sous la vue. Pour consulter une documentation de référence organisée par la classe définissant le comportement, voir Vues fondées sur les classes.

Voir aussi

Classy Class-Based Views propose une interface agréable pour naviguer dans la hiérarchie des classes des vues intégrées fondées sur des classes.

## Vues génériques simples

### `View`

class View

Attributs (avec accesseur facultatif) :

- `http_method_names`

Méthodes

- `as_view()`

- `dispatch()`

- `head()`

- `http_method_not_allowed()`

- `setup()`

### `TemplateView`

class TemplateView

Attributs (avec accesseur facultatif) :

- `content_type`

- `extra_context`

- `http_method_names`

- `response_class` [`render_to_response()`]

- `template_engine`

- `template_name` [`get_template_names()`]

Méthodes

- `as_view()`

- `dispatch()`

- `get()`

- `get_context_data()`

- `head()`

- `http_method_not_allowed()`

- `render_to_response()`

- `setup()`

### `RedirectView`

class RedirectView

Attributs (avec accesseur facultatif) :

- `http_method_names`

- `pattern_name`

- `permanent`

- `query_string`

- `url` [`get_redirect_url()`]

Méthodes

- `as_view()`

- `delete()`

- `dispatch()`

- `get()`

- `head()`

- `http_method_not_allowed()`

- `options()`

- `post()`

- `put()`

- `setup()`

## Vues de détail

### `DetailView`

class DetailView

Attributs (avec accesseur facultatif) :

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `extra_context`

- `http_method_names`

- `model`

- `pk_url_kwarg`

- `query_pk_and_slug`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `slug_field` [`get_slug_field()`]

- `slug_url_kwarg`

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_field`

- `template_name_suffix`

Méthodes

- `as_view()`

- `dispatch()`

- `get()`

- `get_context_data()`

- `get_object()`

- `head()`

- `http_method_not_allowed()`

- `render_to_response()`

- `setup()`

## Vues de liste

### `ListView`

class ListView

Attributs (avec accesseur facultatif) :

- `allow_empty` [`get_allow_empty()`]

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `extra_context`

- `http_method_names`

- `model`

- `ordering` [`get_ordering()`]

- `paginate_by` [`get_paginate_by()`]

- `paginate_orphans` [`get_paginate_orphans()`]

- `paginator_class`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_suffix`

Méthodes

- `as_view()`

- `dispatch()`

- `get()`

- `get_context_data()`

- `get_paginator()`

- `head()`

- `http_method_not_allowed()`

- `paginate_queryset()`

- `render_to_response()`

- `setup()`

## Vues d’édition

### `FormView`

class FormView

Attributs (avec accesseur facultatif) :

- `content_type`

- `extra_context`

- `form_class` [`get_form_class()`]

- `http_method_names`

- `initial` [`get_initial()`]

- `prefix` [`get_prefix()`]

- `response_class` [`render_to_response()`]

- `success_url` [`get_success_url()`]

- `template_engine`

- `template_name` [`get_template_names()`]

Méthodes

- `as_view()`

- `dispatch()`

- `form_invalid()`

- `form_valid()`

- `get()`

- `get_context_data()`

- `get_form()`

- `get_form_kwargs()`

- `http_method_not_allowed()`

- `post()`

- `put()`

- `setup()`

### `CreateView`

class CreateView

Attributs (avec accesseur facultatif) :

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `extra_context`

- `fields`

- `form_class` [`get_form_class()`]

- `http_method_names`

- `initial` [`get_initial()`]

- `model`

- `pk_url_kwarg`

- `prefix` [`get_prefix()`]

- `query_pk_and_slug`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `slug_field` [`get_slug_field()`]

- `slug_url_kwarg`

- `success_url` [`get_success_url()`]

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_field`

- `template_name_suffix`

Méthodes

- `as_view()`

- `dispatch()`

- `form_invalid()`

- `form_valid()`

- `get()`

- `get_context_data()`

- `get_form()`

- `get_form_kwargs()`

- `get_object()`

- `head()`

- `http_method_not_allowed()`

- `post()`

- `put()`

- `render_to_response()`

- `setup()`

### `UpdateView`

class UpdateView

Attributs (avec accesseur facultatif) :

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `extra_context`

- `fields`

- `form_class` [`get_form_class()`]

- `http_method_names`

- `initial` [`get_initial()`]

- `model`

- `pk_url_kwarg`

- `prefix` [`get_prefix()`]

- `query_pk_and_slug`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `slug_field` [`get_slug_field()`]

- `slug_url_kwarg`

- `success_url` [`get_success_url()`]

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_field`

- `template_name_suffix`

Méthodes

- `as_view()`

- `dispatch()`

- `form_invalid()`

- `form_valid()`

- `get()`

- `get_context_data()`

- `get_form()`

- `get_form_kwargs()`

- `get_object()`

- `head()`

- `http_method_not_allowed()`

- `post()`

- `put()`

- `render_to_response()`

- `setup()`

### `DeleteView`

class DeleteView

Attributs (avec accesseur facultatif) :

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `extra_context`

- `http_method_names`

- `model`

- `pk_url_kwarg`

- `query_pk_and_slug`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `slug_field` [`get_slug_field()`]

- `slug_url_kwarg`

- `success_url` [`get_success_url()`]

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_field`

- `template_name_suffix`

Méthodes

- `as_view()`

- `delete()`

- `dispatch()`

- `get()`

- `get_context_data()`

- `get_object()`

- `head()`

- `http_method_not_allowed()`

- `post()`

- `render_to_response()`

- `setup()`

## Vues basées sur les dates

### `ArchiveIndexView`

class ArchiveIndexView

Attributs (avec accesseur facultatif) :

- `allow_empty` [`get_allow_empty()`]

- `allow_future` [`get_allow_future()`]

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `date_field` [`get_date_field()`]

- `extra_context`

- `http_method_names`

- `model`

- `ordering` [`get_ordering()`]

- `paginate_by` [`get_paginate_by()`]

- `paginate_orphans` [`get_paginate_orphans()`]

- `paginator_class`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_suffix`

Méthodes

- `as_view()`

- `dispatch()`

- `get()`

- `get_context_data()`

- `get_date_list()`

- `get_dated_items()`

- `get_dated_queryset()`

- `get_paginator()`

- `head()`

- `http_method_not_allowed()`

- `paginate_queryset()`

- `render_to_response()`

- `setup()`

### `YearArchiveView`

class YearArchiveView

Attributs (avec accesseur facultatif) :

- `allow_empty` [`get_allow_empty()`]

- `allow_future` [`get_allow_future()`]

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `date_field` [`get_date_field()`]

- `extra_context`

- `http_method_names`

- `make_object_list` [`get_make_object_list()`]

- `model`

- `ordering` [`get_ordering()`]

- `paginate_by` [`get_paginate_by()`]

- `paginate_orphans` [`get_paginate_orphans()`]

- `paginator_class`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_suffix`

- `year` [`get_year()`]

- `year_format` [`get_year_format()`]

Méthodes

- `as_view()`

- `dispatch()`

- `get()`

- `get_context_data()`

- `get_date_list()`

- `get_dated_items()`

- `get_dated_queryset()`

- `get_paginator()`

- `head()`

- `http_method_not_allowed()`

- `paginate_queryset()`

- `render_to_response()`

- `setup()`

### `MonthArchiveView`

class MonthArchiveView

Attributs (avec accesseur facultatif) :

- `allow_empty` [`get_allow_empty()`]

- `allow_future` [`get_allow_future()`]

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `date_field` [`get_date_field()`]

- `extra_context`

- `http_method_names`

- `model`

- `month` [`get_month()`]

- `month_format` [`get_month_format()`]

- `ordering` [`get_ordering()`]

- `paginate_by` [`get_paginate_by()`]

- `paginate_orphans` [`get_paginate_orphans()`]

- `paginator_class`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_suffix`

- `year` [`get_year()`]

- `year_format` [`get_year_format()`]

Méthodes

- `as_view()`

- `dispatch()`

- `get()`

- `get_context_data()`

- `get_date_list()`

- `get_dated_items()`

- `get_dated_queryset()`

- `get_next_month()`

- `get_paginator()`

- `get_previous_month()`

- `head()`

- `http_method_not_allowed()`

- `paginate_queryset()`

- `render_to_response()`

- `setup()`

### `WeekArchiveView`

class WeekArchiveView

Attributs (avec accesseur facultatif) :

- `allow_empty` [`get_allow_empty()`]

- `allow_future` [`get_allow_future()`]

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `date_field` [`get_date_field()`]

- `extra_context`

- `http_method_names`

- `model`

- `ordering` [`get_ordering()`]

- `paginate_by` [`get_paginate_by()`]

- `paginate_orphans` [`get_paginate_orphans()`]

- `paginator_class`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_suffix`

- `week` [`get_week()`]

- `week_format` [`get_week_format()`]

- `year` [`get_year()`]

- `year_format` [`get_year_format()`]

Méthodes

- `as_view()`

- `dispatch()`

- `get()`

- `get_context_data()`

- `get_date_list()`

- `get_dated_items()`

- `get_dated_queryset()`

- `get_paginator()`

- `head()`

- `http_method_not_allowed()`

- `paginate_queryset()`

- `render_to_response()`

- `setup()`

### `DayArchiveView`

class DayArchiveView

Attributs (avec accesseur facultatif) :

- `allow_empty` [`get_allow_empty()`]

- `allow_future` [`get_allow_future()`]

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `date_field` [`get_date_field()`]

- `day` [`get_day()`]

- `day_format` [`get_day_format()`]

- `extra_context`

- `http_method_names`

- `model`

- `month` [`get_month()`]

- `month_format` [`get_month_format()`]

- `ordering` [`get_ordering()`]

- `paginate_by` [`get_paginate_by()`]

- `paginate_orphans` [`get_paginate_orphans()`]

- `paginator_class`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_suffix`

- `year` [`get_year()`]

- `year_format` [`get_year_format()`]

Méthodes

- `as_view()`

- `dispatch()`

- `get()`

- `get_context_data()`

- `get_date_list()`

- `get_dated_items()`

- `get_dated_queryset()`

- `get_next_day()`

- `get_next_month()`

- `get_paginator()`

- `get_previous_day()`

- `get_previous_month()`

- `head()`

- `http_method_not_allowed()`

- `paginate_queryset()`

- `render_to_response()`

- `setup()`

### `TodayArchiveView`

class TodayArchiveView

Attributs (avec accesseur facultatif) :

- `allow_empty` [`get_allow_empty()`]

- `allow_future` [`get_allow_future()`]

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `date_field` [`get_date_field()`]

- `day` [`get_day()`]

- `day_format` [`get_day_format()`]

- `extra_context`

- `http_method_names`

- `model`

- `month` [`get_month()`]

- `month_format` [`get_month_format()`]

- `ordering` [`get_ordering()`]

- `paginate_by` [`get_paginate_by()`]

- `paginate_orphans` [`get_paginate_orphans()`]

- `paginator_class`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_suffix`

- `year` [`get_year()`]

- `year_format` [`get_year_format()`]

Méthodes

- `as_view()`

- `dispatch()`

- `get()`

- `get_context_data()`

- `get_date_list()`

- `get_dated_items()`

- `get_dated_queryset()`

- `get_next_day()`

- `get_next_month()`

- `get_paginator()`

- `get_previous_day()`

- `get_previous_month()`

- `head()`

- `http_method_not_allowed()`

- `paginate_queryset()`

- `render_to_response()`

- `setup()`

### `DateDetailView`

class DateDetailView

Attributs (avec accesseur facultatif) :

- `allow_future` [`get_allow_future()`]

- `content_type`

- `context_object_name` [`get_context_object_name()`]

- `date_field` [`get_date_field()`]

- `day` [`get_day()`]

- `day_format` [`get_day_format()`]

- `extra_context`

- `http_method_names`

- `model`

- `month` [`get_month()`]

- `month_format` [`get_month_format()`]

- `pk_url_kwarg`

- `query_pk_and_slug`

- `queryset` [`get_queryset()`]

- `response_class` [`render_to_response()`]

- `slug_field` [`get_slug_field()`]

- `slug_url_kwarg`

- `template_engine`

- `template_name` [`get_template_names()`]

- `template_name_field`

- `template_name_suffix`

- `year` [`get_year()`]

- `year_format` [`get_year_format()`]

Méthodes

- `as_view()`

- `dispatch()`

- `get()`

- `get_context_data()`

- `get_next_day()`

- `get_next_month()`

- `get_object()`

- `get_previous_day()`

- `get_previous_month()`

- `head()`

- `http_method_not_allowed()`

- `render_to_response()`

- `setup()`