Skip to content

Instantly share code, notes, and snippets.

Last active August 25, 2020 06:07
What would you like to do?
class User(models.Model):
name = models.CharField(max_length=60)
email = models.EmailField()
class Address(models.Model):
detail = models.CharField(max_length=100)
city = models.FloatField()
user = models.ForeignKey(User, related_name="addresses", on_delete=models.CASCADE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment