Django - DRF - particular prefetch query -


i need particular query
have list of missions, mission package of 1 or more service offers , service offer service customer specific parameters (price, duration, ...) , want filter missions on service.

example:

missions :

[ name : 010101 service offers labels : facelift, painting date : 08/22/2015 2:00pm ] [...] 

if search missions "facelift" service :

    mission.objects.select_related('costumer')     .prefetch_related(         prefetch(            'service_offers',            queryset = serviceoffer.objects.select_related('service')                                   .filter(service__name__exact = "facelift")         )     ) 

the result be

name : mission 1 service offers labels : facelift date : 08/22/2015 2:00pm 

but want

name : mission 1 service offers labels : facelift, painting date : 08/22/2015 2:00pm 


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -