class documentation

class DateMixin:

Known subclasses: django.views.generic.dates.BaseDateDetailView, django.views.generic.dates.BaseDateListView

View In Hierarchy

Mixin class for views manipulating date-based data.
Method get​_allow​_future Return True if the view should be allowed to display objects from the future.
Method get​_date​_field Get the name of the date field to be used to filter by.
Class Variable allow​_future Undocumented
Class Variable date​_field Undocumented
Method ​_make​_date​_lookup​_arg Convert a date into a datetime when the date field is a DateTimeField.
Method ​_make​_single​_date​_lookup Get the lookup kwargs for filtering on a single date.
Property uses​_datetime​_field Return True if the date field is a DateTimeField and False if it's a DateField.
def get_allow_future(self):
Return True if the view should be allowed to display objects from the future.
def get_date_field(self):
Get the name of the date field to be used to filter by.
allow_future: bool =

Undocumented

date_field =

Undocumented

def _make_date_lookup_arg(self, value):

Convert a date into a datetime when the date field is a DateTimeField.

When time zone support is enabled, date is assumed to be in the current time zone, so that displayed items are consistent with the URL.

def _make_single_date_lookup(self, date):

Get the lookup kwargs for filtering on a single date.

If the date field is a DateTimeField, we can't just filter on date_field=date because that doesn't take the time into account.

@cached_property
uses_datetime_field =
Return True if the date field is a DateTimeField and False if it's a DateField.