2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-11 07:24:15 +00:00

Parameter ordering fix (#3704)

* Hard-code URL fforr loadPartParameterTable function

* Improve API efficiency for including parameter data in Part query

* Fix loading of part parameter data into table
This commit is contained in:
Oliver
2022-09-21 23:31:24 +10:00
committed by GitHub
parent 33326f6eaf
commit 829a9d8311
4 changed files with 32 additions and 7 deletions

View File

@ -1605,6 +1605,20 @@ class PartParameterList(ListCreateAPI):
queryset = PartParameter.objects.all()
serializer_class = part_serializers.PartParameterSerializer
def get_serializer(self, *args, **kwargs):
"""Return the serializer instance for this API endpoint.
If requested, extra detail fields are annotated to the queryset:
- template_detail
"""
try:
kwargs['template_detail'] = str2bool(self.request.GET.get('template_detail', True))
except AttributeError:
pass
return self.serializer_class(*args, **kwargs)
filter_backends = [
DjangoFilterBackend
]