Added 'manufacturer' model

This commit is contained in:
Oliver Walters 2017-03-29 00:23:51 +11:00
parent 277b4360e3
commit ecab28de2c
2 changed files with 14 additions and 4 deletions

View File

@ -8,4 +8,5 @@ class CompanyAdmin(admin.ModelAdmin):
admin.site.register(Customer, CompanyAdmin)
admin.site.register(Supplier, CompanyAdmin)
admin.site.register(Manufacturer, CompanyAdmin)
admin.site.register(SupplierPart)

View File

@ -11,6 +11,12 @@ class Supplier(Company):
"""
pass
class Manufacturer(Company):
""" Represents a manfufacturer
"""
pass
class Customer(Company):
@ -26,12 +32,15 @@ class SupplierPart(models.Model):
- A Part may be available from multiple suppliers
"""
supplier = models.ForeignKey(Supplier,
on_delete=models.CASCADE)
part = models.ForeignKey(Part,
on_delete=models.CASCADE)
MPN = models.CharField(max_length=100)
supplier = models.ForeignKey(Supplier,
on_delete=models.CASCADE)
SKU = models.CharField(max_length=100)
manufacturer = models.ForeignKey(Manufacturer, blank=True, null=True, on_delete=models.CASCADE)
MPN = models.CharField(max_length=100, blank=True)
URL = models.URLField(blank=True)
description = models.CharField(max_length=250, blank=True)