#12286: Table for Model that has been proxied may not be created
------------------------------------------+---------------------------------
 Reporter:  telenieko                     |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  1.1       
 Keywords:                                |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 Hi there,

 Imagine you have

 app1/models.py::
 {{{
 #!python

     from app2.models import NiceModel
     class ProxyModel(NiceModel):
         class Meta:
             proxy = True
 }}}

 app2/models.py::
 {{{
 #!python

    from django.db import models

    class NiceModel(models.Model):
        pass
 }}}

 With this code, "manage.py syncdb" will likely first "see" 'ProxyModel'.
 In [source:django/trunk/django/core/management/commands/syncdb.py#11780
 syncdb.py]:

   *  It will 'try' to (line 70) create a table for it, without doing
 anything.
   *  But adding "app2_nicemodel" (line 82) to the list of tables "it has
 taken care of"
   *  For that, when syncdb passes throught NiceModel it won't create any
 table as 'app2_nicemodel' (line 66) appears as created.

 To reproduce that you need syncdb to be taking into account the "proxy"
 models before the realones (may happen when the "proxying" app is
 alphabetically before the real one).

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12286>
Django <http://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 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-updates?hl=en.


Reply via email to