mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Peppy fixes
This commit is contained in:
parent
00c21d521e
commit
2202dfd55d
@ -3,7 +3,6 @@ dist: xenial
|
|||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- 3.5
|
- 3.5
|
||||||
- 3.6
|
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt-packages:
|
apt-packages:
|
||||||
|
@ -67,7 +67,6 @@ class PartDetail(DraftRUDView):
|
|||||||
|
|
||||||
class PartList(generics.ListCreateAPIView):
|
class PartList(generics.ListCreateAPIView):
|
||||||
|
|
||||||
#queryset = Part.objects.all()
|
|
||||||
serializer_class = PartSerializer
|
serializer_class = PartSerializer
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
@ -86,11 +85,13 @@ class PartList(generics.ListCreateAPIView):
|
|||||||
if self.request.query_params.get('include_child_categories', None):
|
if self.request.query_params.get('include_child_categories', None):
|
||||||
childs = category.getUniqueChildren()
|
childs = category.getUniqueChildren()
|
||||||
for child in childs:
|
for child in childs:
|
||||||
if child == cat_id: continue
|
# Ignore the top-level category (already filtered)
|
||||||
|
if child == cat_id:
|
||||||
|
continue
|
||||||
flt |= Q(category=child)
|
flt |= Q(category=child)
|
||||||
|
|
||||||
return Part.objects.filter(flt)
|
return Part.objects.filter(flt)
|
||||||
|
|
||||||
# Default - return all parts
|
# Default - return all parts
|
||||||
return Part.objects.all()
|
return Part.objects.all()
|
||||||
|
|
||||||
@ -105,7 +106,6 @@ class PartList(generics.ListCreateAPIView):
|
|||||||
]
|
]
|
||||||
|
|
||||||
filter_fields = [
|
filter_fields = [
|
||||||
#'category',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
ordering_fields = [
|
ordering_fields = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user