title: Django - How to reference a specific type in a generic foreign key?
body: <p><br/>
  I made a generic foreign key to be able to reference any type (A or B) of model in the Report model in a generic way.<br/>
  It works fine but my problem is that now, I need to make a query to retrieve all Report instance referencing a specific type of Model (e.g. all Report with a foreign_key referencing class A). I tried to access the content_type in the database but apparently it is not possible (the variable does not exist...)
  <br/>Here are my models:<br/></p>
  
  <pre><code>class Report(models.Model):
    content_type = models.ForeignKey(ContentType)
    object_id = models.CharField(max_length=50)
    reported_item = generic.GenericForeignKey('content_type', 'object_id')
  
  class A(models.Model):
    reports = generic.GenericRelation(Report)
  
  class B(models.Model):
    reports = generic.GenericRelation(Report)
  </code></pre>
  
  <p>Do you have any idea how to do that?<br/>
  Just in case it would change anything, I use mongoDB for my database.<br/>
  Thanks very much!</p>
  
  <p>EDIT:<br/>
  When I display the report object in the db, here is the result:<br/></p>
  
  <pre><code>db.website_report.findOne()
  {
  "_id" : ObjectId("50afa903a96c5c2f63000001"),
  "content_type_id" : ObjectId("50afa903a96c5c2f63000000"),
  "object_id" : "50afa8a8a96c5c2f53000001",
  }
  </code></pre>
  
  <p>As you can see, the content of the database has nothing similar with my models so I don't know how to do a query to get all the report having a foreign_key of A.<br/>
  Can you help me?</p>