Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Last active August 25, 2020 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/ffc03ca7036d32cde8498255edfacbcd to your computer and use it in GitHub Desktop.
Save velotiotech/ffc03ca7036d32cde8498255edfacbcd to your computer and use it in GitHub Desktop.
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