code: def get_queryset(self):
          
          kwargs = {}
          if self.ends_at:
              kwargs.update({'%s__lt' % self.date_field: self.ends_at})
          return super(BeforeMixin, self).get_queryset().filter(**kwargs)
docs: Implements before date filtering on ``date_field``