class DateMixin

from django.views.generic.dates import DateMixin
Hierarchy diagram Documentation Source code
Mixin class for views manipulating date-based data.

Attributes

  Defined in
allow_future = False DateMixin
date_field = None DateMixin
Expand Collapse

Methods

def get_allow_future(self): DateMixin

Returns `True` if the view should be allowed to display objects from
the future.
157
158
159
160
161
162
def get_allow_future(self):
    """
    Returns `True` if the view should be allowed to display objects from
    the future.
    """
    return self.allow_future

def get_date_field(self): DateMixin

Get the name of the date field to be used to filter by.
149
150
151
152
153
154
155
def get_date_field(self):
    """
    Get the name of the date field to be used to filter by.
    """
    if self.date_field is None:
        raise ImproperlyConfigured(u"%s.date_field is required." % self.__class__.__name__)
    return self.date_field