mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-06 05:30:56 +00:00
Ability to include part_detail in build API
- Build list now uses bootstrapTable
This commit is contained in:
@ -11,6 +11,8 @@ from rest_framework import generics, permissions
|
||||
|
||||
from django.conf.urls import url, include
|
||||
|
||||
from InvenTree.helpers import str2bool
|
||||
|
||||
from .models import Build, BuildItem
|
||||
from .serializers import BuildSerializer, BuildItemSerializer
|
||||
|
||||
@ -39,6 +41,17 @@ class BuildList(generics.ListCreateAPIView):
|
||||
'part',
|
||||
]
|
||||
|
||||
def get_serializer(self, *args, **kwargs):
|
||||
|
||||
try:
|
||||
part_detail = str2bool(self.request.GET.get('part_detail', None))
|
||||
except AttributeError:
|
||||
part_detail = None
|
||||
|
||||
kwargs['part_detail'] = part_detail
|
||||
|
||||
return self.serializer_class(*args, **kwargs)
|
||||
|
||||
|
||||
class BuildDetail(generics.RetrieveUpdateAPIView):
|
||||
""" API endpoint for detail view of a Build object """
|
||||
|
Reference in New Issue
Block a user