Hi,

according to Django docs (http://docs.djangoproject.com/en/1.2/topics/
db/models/#multi-table-inheritance) there should be a automaticly set
parent link, when using multi-table inheritance. I'd like to do
something like that:

Class A(models.Model):
    .....

Class B(A):
    .....

a = A.objects.get(pk=100)
b = B.objects.get(pk=100)

# Does work
a.b     # is the same as b

# Doesn't work
b.a     # should return a

I can set-up an OneToOne field in each child class, but, obviously,
it's not the optimal way to go. Now i'm using an abstract class in the
middle, which defines a parent_link field, but i wonder, if there is
an easier way.

Alendit

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

Reply via email to