These are chat archives for django/django

26th
Jun 2016
alstonChang
@Manuel4131
Jun 26 2016 11:11
Hi, after reading the release support here, https://goo.gl/vmRM3x
I become so confused to create my website using Django 1.8LTS or 1.9.
The website will be responsible for selling some products online.
Any suggestions, thanks. I'm not going to consider the develop revision.
Dušan Plavák
@ddeath
Jun 26 2016 20:19

Hey guys if I have

class UserProfile(models.Model):
    user = models.OneToOneField(User, null=False)

How can I access user profile from user? when I have self.user, I was trying self.user.profile, self.user.userProfile but no luck

Dušan Plavák
@ddeath
Jun 26 2016 20:29

never mind it should be

class UserProfile(models.Model):
    user = models.OneToOneField(User, related_name='profile', null=False)

and then I can call self.user.profile