Skip to content

Instantly share code, notes, and snippets.

@valerybriz
Last active May 2, 2019 21:45
Show Gist options
  • Save valerybriz/10cd9a19da9485c78b2ffebd7862c927 to your computer and use it in GitHub Desktop.
Save valerybriz/10cd9a19da9485c78b2ffebd7862c927 to your computer and use it in GitHub Desktop.
Django example schema
class User(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.TextField()
email = models.TextField()
age = models.PositiveSmallIntegerField()
team = models.ForeignKey(Team, on_delete=models.PROTECT, related_name='users', null=True)
class Team(models.Model):
location = models.TextField()
name = models.TextField()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment