#28746: New model missing abstract model inherited Meta/Options
-------------------------------------+-------------------------------------
               Reporter:  JP         |          Owner:  nobody
  Navarro                            |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  1.10
  layer (models, ORM)                |       Keywords:  abstract Meta
               Severity:  Normal     |  inheritance
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Given:

 {{{
 class AbstractGlue2Model(models.Model):
     ID = models.CharField(primary_key=True, max_length=200)
     <stuff>
     class Meta:
         abstract = True
         db_name = 'glue2'
 ...
 class Contact(AbstractGlue2Model):
     Detail = models.CharField(max_length=128)
     Type = models.CharField(max_length=16)
 }}}


 A migrate that should create the new Contacts DB objects sees inherited
 fields (such as ID), but is missing Meta db_name value:


 {{{
 (Pdb) pp hints['model']
 <class 'Contact'>
 (Pdb) pp hints['model']._meta.db_name
 *** AttributeError: AttributeError("'Options' object has no attribute
 'db_name'",)
 (Pdb) pp hints['model']._meta.abstract
 False
 (Pdb) pp hints['model'].ID
 <django.db.models.query_utils.DeferredAttribute object at 0x10f97d6d0>
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28746>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.661937fa0991e20110f7a00f7978a0e8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to