Since yesterday, I've put together a small testapp to better present
my problem.

I have the following models.py file:
from django.db import models

class AbstractTaskOrProject(models.Model):
  parent = models.ForeignKey('AbstractProject', null=True)

  class Meta:
    abstract = True

class AbstractProject(AbstractTaskOrProject):
  pass

class Project(AbstractProject):
  pass

class SubProject(AbstractProject):
  pass

class Task(AbstractTaskOrProject):
  pass

Then I've run ./manage.py shell to present my point. The output is at
http://python.pastebin.com/m52331203

The weirdest thing to me is that

>>> from django.db.models.query_utils import CollectedObjects
>>> a = CollectedObjects()
>>> project._collect_sub_objects(a)

recognizes the subproject

Is it a bug not to be able to access the Subproject instances from a
parent Project?

V

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.


Reply via email to