2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-09 15:10:54 +00:00

db unique_together

This commit is contained in:
Oliver Walters
2017-04-16 01:24:00 +10:00
parent 4f6802b9bf
commit d0a66390f5
4 changed files with 12 additions and 48 deletions

View File

@ -78,6 +78,9 @@ class SupplierPriceBreak(models.Model):
quantity = models.PositiveIntegerField()
cost = models.DecimalField(max_digits=10, decimal_places=3)
class Meta:
unique_together = ("part", "quantity")
def __str__(self):
return "{mpn} - {cost}{currency} @ {quan}".format(
mpn=self.part.MPN,