[Fixed]-CBV overrides django-filter context

0👍

Got it working by doing the following:

def get_context_data(self, **kwargs):
    ctx = super(ListReservations, self).get_context_data()
    ctx['today'] = datetime.datetime.now().strftime('%d/%m')
    ctx['filter'] = self.get_filterset(self.get_filterset_class())
    return ctx

Hope it helps someone someday 🙂

1👍

The super call for get_context_data should include kwargs:

ctx = super(ListReservations, self).get_context_data(**kwargs)

Leave a comment