title: order by condition Django
body: <p>I have 3 models userprofile and group :</p>
  
  <pre><code>class UserProfile(models.Model):    
      slug = models.SlugField(max_length=200)
      user = models.ForeignKey(User, unique =True)
      professionalNetwork = models.ForeignKey('SubForum',null=True, blank=True)
  
  class Group(models.Model):
      slug = models.SlugField(max_length=200)
      name = models.CharField(max_length=200)
      professionalNetwork = models.ForeignKey('SubForum')
  
  class SubForum(models.Model):
     name = models.CharField(max_length=200)
  </code></pre>
  
  <p>How do I get all the groups ordered by first the one that have the same professional network as a specific user then the rest ?</p>
  
  <p>I was looking into something like Group.objects.all().order_by('-professionalNetwork = profile.professionalNetwork') but this doesn't work of course ^^</p>
  
  <p>Thanks you</p>