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
Post a Comment