David Leonard 10 yıl önce
ebeveyn
işleme
9da584ea96
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  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