mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
"URL" is renamed to "link" in the URL
This commit is contained in:
parent
511cdef323
commit
d739c2dea8
@ -243,6 +243,12 @@ class PartList(generics.ListCreateAPIView):
|
||||
else:
|
||||
item['category__name'] = None
|
||||
|
||||
# Rename "URL" to "link" to distinguish from lower-case "url",
|
||||
# which is the web address of the item itself
|
||||
if 'URL' in item.keys():
|
||||
item['link'] = item['URL']
|
||||
del item['URL']
|
||||
|
||||
return Response(data)
|
||||
|
||||
def get_queryset(self):
|
||||
|
@ -86,6 +86,7 @@ class PartSerializer(InvenTreeModelSerializer):
|
||||
on_order = serializers.FloatField(read_only=True)
|
||||
thumbnail = serializers.CharField(source='get_thumbnail_url', read_only=True)
|
||||
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
||||
link = serializers.CharField(source='URL')
|
||||
used_in = serializers.IntegerField(source='used_in_count', read_only=True)
|
||||
|
||||
@staticmethod
|
||||
@ -114,6 +115,7 @@ class PartSerializer(InvenTreeModelSerializer):
|
||||
'IPN',
|
||||
'is_template',
|
||||
'keywords',
|
||||
'link',
|
||||
'name',
|
||||
'notes',
|
||||
'on_order',
|
||||
@ -125,7 +127,6 @@ class PartSerializer(InvenTreeModelSerializer):
|
||||
'total_stock',
|
||||
'units',
|
||||
'used_in',
|
||||
'URL',
|
||||
'url', # Link to the part detail page
|
||||
'variant_of',
|
||||
'virtual',
|
||||
|
Loading…
Reference in New Issue
Block a user