2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-26 00:30:51 +00:00

Add PartParameter table

This commit is contained in:
Oliver Walters
2019-08-20 12:31:43 +10:00
parent 3447123196
commit 2f6357b136
2 changed files with 45 additions and 0 deletions
InvenTree/part

@ -1028,6 +1028,28 @@ class PartStar(models.Model):
unique_together = ['part', 'user']
class PartParameter(models.Model):
""" A PartParameter provides key:value pairs for extra
parameters fields/values to be added to a Part.
This allows users to arbitrarily assign data fields to a Part
beyond the built-in attributes.
Attributes:
part: Link to a Part object
name: The name (key) of the Parameter [string]
data: The data (value) of the Parameter [string]
"""
part = models.ForeignKey(Part, on_delete=models.CASCADE,
related_name='parameters',
help_text='Parent Part',
)
name = models.CharField(max_length=100, help_text='Parameter Name')
data = models.CharField(max_length=100, help_text='Parameter Value')
class BomItem(models.Model):
""" A BomItem links a part to its component items.
A part can have a BOM (bill of materials) which defines