Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

django queryset limited choice filed by fk using -'django-filter'

django queryset limited choice filed by fk  using -'django-filter'

I have two models


To display data using the django-filter.
Unfortunately, when you create a form in the select-field all the values of the model Asset, and I would just those related to FK model Notification.

 def get_queryset(self):
        self.filter = NotificationListFilter(
            queryset = Notification.objects.all()

        return self.filter
    except :
        return Notification.objects.order_by('-asset__system')

In some way I can build queryset this to happen?

asked Sep 7, 2015 by rajesh
0 votes

Related Hot Questions

Government Jobs Opening