On Tue, Jul 14, 2009 at 7:15 AM, Luc Saffre <luc.saf...@gmx.net> wrote:
> > """ > Can somebody explain why this testcase fails? It looks as if the > attribute 'a' passed to the E instance just gets ignored. > I guess that it has to do with the fact that E inherits Model more than > once. > > >>> i1 = D(a='D') > >>> i1.a > 'D' > > >>> i2 = E(a='E') > >>> i2.a > 'E' > > The failure is:: > > Failed example: > i2.a > Expected: > 'E' > Got: > '' > > To try this test, save the body of this mail as a file models.py > together with an empty __init__.py in some new directory on your > PYTHONPATH, add this to your INSTALLED_APPS and then run "manage.py test". > > """ > > from django.db import models > > class A(models.Model): > a = models.CharField(max_length=100) > class Meta: > abstract = True > > class B(A): pass > class C(A): pass > > class D(B): pass > class E(B,C): pass > > > > > > This looks like an instance of this: http://code.djangoproject.com/ticket/10808 bug. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." -- Voltaire "The people's good is the highest law." -- Cicero "Code can always be simpler than you think, but never as simple as you want" -- Me --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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=en -~----------~----~----~----~------~----~------~--~---