Showing Field Data On Another View

42 Views Asked by At

Thank You, trying to show the created_date field to the front table but i get an error, if i don't filter and use the all() method i am able to populate all the field data, but i would like to populate created_date field of member.I Get KEY ERROR "list_id"

class ListListView(ListView):
    model = HBTYList
    template_name = "accounts/modals/nomodal/index.html"
    paginate_by = 3


    def get_queryset(self):
        qs = self.model.objects.all().order_by('-id')
        p_f = HbtyCustomerListFilter(self.request.GET, queryset=qs)
        return p_f.qs

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        context['dc'] = HBTYItem.objects.filter(hbty_cust_id=self.kwargs["list_id"]) #Fix this method to show created_data
        context['filter'] = HbtyCustomerListFilter(self.request.GET, queryset=self.get_queryset())
        return context
0

There are 0 best solutions below