title: A generic one-to-one relation in Django
body: <p>I have an image model:</p>
  
  <pre><code>class Image(models.Model):
      content_type = models.ForeignKey(ContentType)
      object_id = models.PositiveIntegerField()
      content_object = generic.GenericForeignKey()
      image = models.ImageField()
  </code></pre>
  
  <p>I also have a model which has fields</p>
  
  <pre><code>class MyModel(models.Model):
      logo = models.ImageField()
      icon = models.ImageField()
      images = generic.GenericRelation(Image)
  </code></pre>
  
  <p>I want <code>logo</code> and <code>icon</code> to also use the generic relation <code>Image</code>. How can I do this?</p>
  
  <p>I use the generic model <code>Image</code> in many models so it has to be a generic relation. I just want to use the same model for all images even though it's icons, profile pictures or whatever.</p>
  
  <p>The best would be if Django had a field <code>generic.GenericOneToOneRelation(Image)</code> or something :-)</p>
  
  <p>The only solution I can think of is</p>
  
  <pre><code>class MyModel(models.Model):
      logo = models.ForeignKey(Image)
      icon = models.ForeignKey(Image)
      images = generic.GenericRelation(Image)
  </code></pre>
  
  <p>and then selecting <code>logo</code> and <code>icon</code> after uploading <code>images</code> and excluding <code>logo</code> and <code>icon</code> from <code>images</code> when I'm printing the <code>images</code> related to this model. Would this be a good solution?</p>