Organizational Research By

Surprising Reserch Topic

Experts Most Trusted 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


Notification
Asset


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):
    try:
        self.filter = NotificationListFilter(
            self.request.GET,
            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
3 views



Related Hot Questions



Government Jobs Opening


...