Pepe fixes

This commit is contained in:
Oliver Walters 2019-04-30 00:18:58 +10:00
parent 8ec4101edd
commit 395db4df38
3 changed files with 6 additions and 22 deletions

View File

@ -11,6 +11,7 @@ from stock.serializers import StockItemSerializerBrief
from .models import Build, BuildItem from .models import Build, BuildItem
class BuildSerializer(InvenTreeModelSerializer): class BuildSerializer(InvenTreeModelSerializer):
""" Serializes a Build object """ """ Serializes a Build object """

View File

@ -29,35 +29,18 @@ class LocationBriefSerializer(serializers.ModelSerializer):
class StockItemSerializerBrief(serializers.ModelSerializer): class StockItemSerializerBrief(serializers.ModelSerializer):
""" """ Brief serializers for a StockItem """
Provide a brief serializer for StockItem
"""
url = serializers.CharField(source='get_absolute_url', read_only=True)
location_name = serializers.CharField(source='location', read_only=True)
part_name = serializers.CharField(source='part.name', read_only=True) part_name = serializers.CharField(source='part.name', read_only=True)
class Meta:
model = StockItem
fields = [
'pk',
'uuid',
'url',
'part_name',
]
class StockItemSerializerBrief(serializers.ModelSerializer):
""" Brief serializers for a StockItem """
location_name = serializers.CharField(source='location', read_only=True)
class Meta: class Meta:
model = StockItem model = StockItem
fields = [ fields = [
'pk', 'pk',
'uuid', 'uuid',
'part', 'part',
'part_name',
'supplier_part', 'supplier_part',
'location', 'location',
'location_name', 'location_name',