mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
PEP fixes
This commit is contained in:
parent
0334035e77
commit
b2c40c91b7
@ -5,7 +5,6 @@ JSON API for the Stock app
|
|||||||
from django_filters.rest_framework import FilterSet, DjangoFilterBackend
|
from django_filters.rest_framework import FilterSet, DjangoFilterBackend
|
||||||
from django_filters import NumberFilter
|
from django_filters import NumberFilter
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.conf.urls import url, include
|
from django.conf.urls import url, include
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
@ -21,9 +20,7 @@ from .serializers import StockTrackingSerializer
|
|||||||
|
|
||||||
from InvenTree.views import TreeSerializer
|
from InvenTree.views import TreeSerializer
|
||||||
from InvenTree.helpers import str2bool, isNull
|
from InvenTree.helpers import str2bool, isNull
|
||||||
from InvenTree.status_codes import StockStatus
|
|
||||||
|
|
||||||
import os
|
|
||||||
from decimal import Decimal, InvalidOperation
|
from decimal import Decimal, InvalidOperation
|
||||||
|
|
||||||
from rest_framework.serializers import ValidationError
|
from rest_framework.serializers import ValidationError
|
||||||
@ -326,11 +323,9 @@ class StockList(generics.ListCreateAPIView):
|
|||||||
try:
|
try:
|
||||||
part_detail = str2bool(self.request.query_params.get('part_detail', None))
|
part_detail = str2bool(self.request.query_params.get('part_detail', None))
|
||||||
location_detail = str2bool(self.request.query_params.get('location_detail', None))
|
location_detail = str2bool(self.request.query_params.get('location_detail', None))
|
||||||
supplier_part_detail = str2bool(self.request.query_params.get('supplier_part_detail', None))
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
part_detail = None
|
part_detail = None
|
||||||
location_detail = None
|
location_detail = None
|
||||||
supplier_part_detail = None
|
|
||||||
|
|
||||||
kwargs['part_detail'] = part_detail
|
kwargs['part_detail'] = part_detail
|
||||||
kwargs['location_detail'] = location_detail
|
kwargs['location_detail'] = location_detail
|
||||||
@ -340,7 +335,7 @@ class StockList(generics.ListCreateAPIView):
|
|||||||
|
|
||||||
return self.serializer_class(*args, **kwargs)
|
return self.serializer_class(*args, **kwargs)
|
||||||
|
|
||||||
# TODO - Override the 'create' method for this view,
|
# TODO - Override the 'create' method for this view,
|
||||||
# to allow the user to be recorded when a new StockItem object is created
|
# to allow the user to be recorded when a new StockItem object is created
|
||||||
|
|
||||||
def get_queryset(self, *args, **kwargs):
|
def get_queryset(self, *args, **kwargs):
|
||||||
@ -350,7 +345,6 @@ class StockList(generics.ListCreateAPIView):
|
|||||||
|
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
|
|
||||||
def filter_queryset(self, queryset):
|
def filter_queryset(self, queryset):
|
||||||
|
|
||||||
# Start with all objects
|
# Start with all objects
|
||||||
|
@ -8,7 +8,6 @@ from .models import StockItem, StockLocation
|
|||||||
from .models import StockItemTracking
|
from .models import StockItemTracking
|
||||||
|
|
||||||
from part.serializers import PartBriefSerializer
|
from part.serializers import PartBriefSerializer
|
||||||
from company.serializers import SupplierPartSerializer
|
|
||||||
from InvenTree.serializers import UserSerializerBrief, InvenTreeModelSerializer
|
from InvenTree.serializers import UserSerializerBrief, InvenTreeModelSerializer
|
||||||
|
|
||||||
|
|
||||||
@ -72,8 +71,6 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
|||||||
)
|
)
|
||||||
|
|
||||||
status_text = serializers.CharField(source='get_status_display', read_only=True)
|
status_text = serializers.CharField(source='get_status_display', read_only=True)
|
||||||
|
|
||||||
#tracking_items = serializers.IntegerField(source='tracking_info_count', read_only=True)
|
|
||||||
|
|
||||||
part_detail = PartBriefSerializer(source='part', many=False, read_only=True)
|
part_detail = PartBriefSerializer(source='part', many=False, read_only=True)
|
||||||
location_detail = LocationBriefSerializer(source='location', many=False, read_only=True)
|
location_detail = LocationBriefSerializer(source='location', many=False, read_only=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user