title: Django, add friends with custom user model
body: <p>I know that I'm reinventing the wheel here, but I just don't like <code>django-friendship</code> and want to write it myself. </p>
  
  <p>Thus, I have custom user model Person </p>
  
  <pre><code>class Person(AbstractBaseUser, PermissionsMixin):
  
      username = models.CharField(('username'), max_length=75, unique=True,
                                  help_text=('Required. 30 characters or fewer. Letters, numbers and '
                                             '@/./+/-/_ characters'),
                                  validators=[
                                      validators.RegexValidator(re.compile('^[\w.@+-]+$'),
                                                                ('Enter a valid username.'), 'invalid')
                                  ])
      ....more other fields....
      friend = models.ForeignKey('self', related_name="friends",  default=None, null=True)
  </code></pre>
  
  <p>As you can see I have foreign key with self or other words oneToMany relationship. </p>
  
  <p>and here is what I have in views.py to add friends </p>
  
  <pre><code>def add_friend(request, username):
      if request.user.is_authenticated():
          user = Person.objects.get_by_natural_key(username)
          if user is not None:
              user.friend = request.user    /// here
          return HttpResponseRedirect('/profile/')
  </code></pre>
  
  <p>I'm getting user which I want to add to my friends by username and set users field(friends) to current user(request user). However, I think that I'm doing something wrong here. </p>
  
  <p>I tried to google it, but didnt find example with <code>ForeignKey('self')</code></p>