def obj_get(self, request, **kwargs): case = get_object_or_not_exist(CommCareCase, kwargs["pk"], kwargs["domain"]) return StockStatus.from_case(case)
def obj_get_list(self, request, **kwargs): location_id = request.GET.get("location_id", None) if location_id: return StockStatus.by_location(kwargs['domain'], location_id) else: return StockStatus.by_domain(kwargs['domain'])