Skip to content

Instantly share code, notes, and snippets.

@godfather68
Last active September 21, 2020 20:43
Show Gist options
  • Save godfather68/0299297a31b0586e016e14cac8266726 to your computer and use it in GitHub Desktop.
Save godfather68/0299297a31b0586e016e14cac8266726 to your computer and use it in GitHub Desktop.
from django.db import models
# Create your models here.
class Customer(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
class Request(models.Model):
customer = models.ForeignKey(Customer, related_name='customer_requests', on_delete=models.CASCADE)
content = models.CharField(max_length=100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment