Last active
May 2, 2019 21:45
-
-
Save valerybriz/10cd9a19da9485c78b2ffebd7862c927 to your computer and use it in GitHub Desktop.
Django example schema
This file contains 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
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