mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 19:46:46 +00:00
Added some docstrings
This commit is contained in:
parent
abe0bbf2e4
commit
af679a1ac6
@ -5,6 +5,9 @@ from django.db import models
|
|||||||
from part.models import Part
|
from part.models import Part
|
||||||
|
|
||||||
class Supplier(models.Model):
|
class Supplier(models.Model):
|
||||||
|
""" Represents a manufacturer or supplier
|
||||||
|
"""
|
||||||
|
|
||||||
name = models.CharField(max_length=100)
|
name = models.CharField(max_length=100)
|
||||||
URL = models.URLField(blank=True)
|
URL = models.URLField(blank=True)
|
||||||
address = models.CharField(max_length=200,
|
address = models.CharField(max_length=200,
|
||||||
@ -21,6 +24,12 @@ class Supplier(models.Model):
|
|||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
class SupplierPart(models.Model):
|
class SupplierPart(models.Model):
|
||||||
|
""" Represents a unique part as provided by a Supplier
|
||||||
|
Each SupplierPart is identified by a MPN (Manufacturer Part Number)
|
||||||
|
Each SupplierPart is also linked to a Part object
|
||||||
|
- A Part may be available from multiple suppliers
|
||||||
|
"""
|
||||||
|
|
||||||
supplier = models.ForeignKey(Supplier,
|
supplier = models.ForeignKey(Supplier,
|
||||||
on_delete=models.CASCADE)
|
on_delete=models.CASCADE)
|
||||||
part = models.ForeignKey(Part,
|
part = models.ForeignKey(Part,
|
||||||
@ -38,6 +47,11 @@ class SupplierPart(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class SupplierPriceBreak(models.Model):
|
class SupplierPriceBreak(models.Model):
|
||||||
|
""" Represents a quantity price break for a SupplierPart
|
||||||
|
- Suppliers can offer discounts at larger quantities
|
||||||
|
- SupplierPart(s) may have zero-or-more associated SupplierPriceBreak(s)
|
||||||
|
"""
|
||||||
|
|
||||||
part = models.ForeignKey(SupplierPart,
|
part = models.ForeignKey(SupplierPart,
|
||||||
on_delete=models.CASCADE)
|
on_delete=models.CASCADE)
|
||||||
quantity = models.IntegerField()
|
quantity = models.IntegerField()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user