Include total stock in PartBrief serializer

This commit is contained in:
Oliver Walters 2019-05-23 21:51:27 +10:00
parent a6f95c70aa
commit d386c2a6f9
2 changed files with 2 additions and 1 deletions

View File

@ -379,7 +379,7 @@ class Part(models.Model):
total -= self.allocation_count
return total
return max(total, 0)
def isStarredBy(self, user):
""" Return True if this part has been starred by a particular user """

View File

@ -50,6 +50,7 @@ class PartBriefSerializer(serializers.ModelSerializer):
'url',
'full_name',
'description',
'total_stock',
'available_stock',
'image_url',
]