class documentation

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
Property uses_datetime_field Return `True` if the date field is a `DateTimeField` and `False` if it's a `DateField`.
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.
def get_allow_future(self): (source)

Return `True` if the view should be allowed to display objects from the future.

def get_date_field(self): (source)

Get the name of the date field to be used to filter by.

allow_future: bool = (source)

Undocumented

date_field = (source)

Undocumented

@cached_property
uses_datetime_field = (source)

Return `True` if the date field is a `DateTimeField` and `False` if it's a `DateField`.

def _make_date_lookup_arg(self, value): (source)

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): (source)

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.