2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 11:35:41 +00:00

Add 'Contact' model to Company app

This commit is contained in:
Oliver
2018-04-30 17:20:01 +10:00
parent f988c9af87
commit feff4f0ddd
2 changed files with 41 additions and 0 deletions

View File

@ -65,3 +65,17 @@ class Company(models.Model):
@property
def has_parts(self):
return self.part_count > 0
class Contact(models.Model):
name = models.CharField(max_length=100)
phone = models.CharField(max_length=100, blank=True)
email = models.EmailField(blank=True)
role = models.CharField(max_length=100, blank=True)
company = models.ForeignKey(Company, related_name='contacts',
on_delete = models.CASCADE)