Created
December 28, 2019 13:46
-
-
Save sam-thecoder/ec2c86dc7f3bf8bbf83768c9a3555904 to your computer and use it in GitHub Desktop.
company model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.contrib.auth.models import User | |
from location.models import Address | |
class Company(models.Model): | |
name = models.CharField(max_length=500) | |
phone = models.CharField(max_length=500) | |
email = models.EmailField(unique=True) | |
address = models.ForeignKey(Address, related_name="companies", on_delete=models.CASCADE, null=True) | |
def __str__(self): | |
return self.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment