Hi,
I have been trying to use inherited models and back references for
filter queries, using django 1.0, 'final'. Whilst I am able to use
back references for the base class, I can not do so for the inherited
class (see example below). Is there any reasons why I should not be
able to do this?
Regards,
Martin
from django.db import models
class Refered(models.Model):
x = models.IntegerField()
class Base(models.Model):
ref = models.ForeignKey(Refered)
class Inherited(Base):
pass
# Then having run manage.py syncdb:
r1 = Refered(x = 1)
r1.save()
r2 = Refered(x = 2)
r2.save()
b = Base(ref = r1)
b.save()
i = Inherited(ref = r2)
i.save()
print Refered.objects.filter(base = b) #This line works
print Refered.objects.filter(derived = d) #This line does not work
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---