Add "pretty" name to the SupplierPart API

- Quick way to ensure the supplier part objects are printed the same way
- Use the pythonic back-end to render the data
This commit is contained in:
Oliver Walters
2020-08-26 23:23:57 +10:00
parent 5aa11063a0
commit 3a75682878
3 changed files with 17 additions and 0 deletions

View File

@ -158,6 +158,11 @@ class SupplierPartList(generics.ListCreateAPIView):
kwargs['manufacturer_detail'] = str2bool(self.request.query_params.get('manufacturer_detail', None))
except AttributeError:
pass
try:
kwargs['pretty'] = str2bool(self.request.query_params.get('pretty', None))
except AttributeError:
pass
kwargs['context'] = self.get_serializer_context()