mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	Specify serializer type for part category
This commit is contained in:
		| @@ -236,6 +236,9 @@ class PartSerializer(InvenTreeModelSerializer): | |||||||
|     thumbnail = serializers.CharField(source='get_thumbnail_url', read_only=True) |     thumbnail = serializers.CharField(source='get_thumbnail_url', read_only=True) | ||||||
|     starred = serializers.SerializerMethodField() |     starred = serializers.SerializerMethodField() | ||||||
|  |  | ||||||
|  |     # PrimaryKeyRelated fields (Note: enforcing field type here results in much faster queries, somehow...) | ||||||
|  |     category = serializers.PrimaryKeyRelatedField(queryset=PartCategory.objects.all()) | ||||||
|  |  | ||||||
|     # TODO - Include annotation for the following fields: |     # TODO - Include annotation for the following fields: | ||||||
|     # allocated_stock = serializers.FloatField(source='allocation_count', read_only=True) |     # allocated_stock = serializers.FloatField(source='allocation_count', read_only=True) | ||||||
|     # bom_items = serializers.IntegerField(source='bom_count', read_only=True) |     # bom_items = serializers.IntegerField(source='bom_count', read_only=True) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user