"""
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



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to