David Leonard 10 anos atrás
pai
commit
9da584ea96
1 arquivos alterados com 8 adições e 0 exclusões
  1. 8 0
      hackathon_starter/hackathon/models.py

+ 8 - 0
hackathon_starter/hackathon/models.py

@@ -1,3 +1,11 @@
 from django.db import models
+from django.contrib.auth.models import User
 
 # Create your models here.
+class UserProfile(models.Model):
+    # This line is required. Links UserProfile to a User model instance.
+    user = models.OneToOneField(User)
+
+    # Override the __unicode__() method to return out something meaningful!
+    def __unicode__(self):
+        return self.user.username