title: Django - Finding all related OneToOneField objects through the foreign object
body: <p>Sorry if that title isn't clear, here's what I'm trying to accomplish:</p>
  <pre><code>class Document(models.Model):
      processed = models.BooleanField(default=False)
  
  class ParentClass(models.Model)
      document = models.OneToOneField(Document, on_delete=models.SET_NULL, null=True)
  
      class Meta:
          abstract = True
  
      def do_something():
          raise NotImplementedError()
  
  class SubclassOne(ParentClass):
      # Some fields.
      def do_something(self):
          # Something specific to this subclass
  
  class SubclassTwo(ParentClass):
      # Some other fields.
      def do_something(self):
          # Something specific to this subclass
  </code></pre>
  <p>My first thought was to try querying through the <code>ParentClass</code></p>
  <pre><code>ParentClass.objects.filter(document__processed=False)
  </code></pre>
  <p>But that doesn't work because the parent class is <code>abstract</code>.</p>
  <p>Now I have tried going through the <code>Document</code> object</p>
  <pre><code>Document.objects.filter(processed=False)
  </code></pre>
  <p>But there doesn't seem to be a way to look up the related objects through each individual <code>Document</code>. I'm not sure that's a good solution anyways because of the tight coupling of the <code>ParentClass</code> to the <code>Document</code>, which shouldn't need to be aware of <code>ParentClass</code>'s implementation.</p>