mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 01:55:39 +00:00
Added REST framework
- /part/ URL is now a JSON api
This commit is contained in:
20
InvenTree/part/serializers.py
Normal file
20
InvenTree/part/serializers.py
Normal file
@ -0,0 +1,20 @@
|
||||
from rest_framework import serializers
|
||||
|
||||
from .models import Part, PartCategory
|
||||
|
||||
class PartSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = Part
|
||||
fields = ('pk',
|
||||
'IPN',
|
||||
'description',
|
||||
'category',
|
||||
'quantity')
|
||||
|
||||
class PartCategorySerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = PartCategory
|
||||
fields = ('pk',
|
||||
'name',
|
||||
'description',
|
||||
'path')
|
Reference in New Issue
Block a user