David Leonard преди 10 години
родител
ревизия
9da584ea96
променени са 1 файла, в които са добавени 8 реда и са изтрити 0 реда
  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