mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Parameter ordering fix (#3704)
* Hard-code URL fforr loadPartParameterTable function * Improve API efficiency for including parameter data in Part query * Fix loading of part parameter data into table
This commit is contained in:
@ -247,6 +247,19 @@ class PartParameterTemplateSerializer(InvenTreeModelSerializer):
|
||||
class PartParameterSerializer(InvenTreeModelSerializer):
|
||||
"""JSON serializers for the PartParameter model."""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Custom initialization method for the serializer.
|
||||
|
||||
Allows us to optionally include or exclude particular information
|
||||
"""
|
||||
|
||||
template_detail = kwargs.pop('template_detail', False)
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
if not template_detail:
|
||||
self.fields.pop('template_detail')
|
||||
|
||||
template_detail = PartParameterTemplateSerializer(source='template', many=False, read_only=True)
|
||||
|
||||
class Meta:
|
||||
|
Reference in New Issue
Block a user