Merge pull request #7 from SchrodingersGat/master

Added 'manufacturer' model
This commit is contained in:
Oliver 2017-03-29 00:24:30 +11:00 committed by GitHub
commit 8b508b6aea
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

@ -13,6 +13,12 @@ class Supplier(Company):
pass
class Manufacturer(Company):
""" Represents a manfufacturer
"""
pass
class Customer(Company):
""" Represents a customer
"""
@ -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)
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)
MPN = models.CharField(max_length=100)
URL = models.URLField(blank=True)
description = models.CharField(max_length=250, blank=True)