diff content/Coding/030-retiring-get-profile-and-auth-profile-module.rst @ 21:21a29f2520ca

Add related_name to UserProfile model example.
author Brian Neal <bgneal@gmail.com>
date Sat, 27 Aug 2016 13:18:54 -0500
parents fa54eda9b809
children
line wrap: on
line diff
--- a/content/Coding/030-retiring-get-profile-and-auth-profile-module.rst	Sat Aug 27 13:04:58 2016 -0500
+++ b/content/Coding/030-retiring-get-profile-and-auth-profile-module.rst	Sat Aug 27 13:18:54 2016 -0500
@@ -84,7 +84,7 @@
 
    class Profile(models.Model):
       """model to represent additional information about users"""
-      user = models.OneToOneField(User)
+      user = models.OneToOneField(User, related_name='profile')
       # ... other custom stuff here
 
 Update the code