#13903: Auto app_label creation fails when model is defined at top-level python
modules
--------------------------------------------------------+-------------------
               Reporter:  petraszd                      |         Owner:  
anonymous
                 Status:  assigned                      |     Milestone:        
   
              Component:  Database layer (models, ORM)  |       Version:  SVN   
   
             Resolution:                                |      Keywords:        
   
           Triage Stage:  Accepted                      |     Has patch:  1     
   
    Needs documentation:  0                             |   Needs tests:  0     
   
Patch needs improvement:  1                             |  
--------------------------------------------------------+-------------------

Comment (by henriquebastos):

 Sorry about the mistaken status change.

 So we have to problems here:

 1) Allow or not this behavior.
 2) Fix the IndexError.

 On the 1st, if someone really want's to work that way, he could define
 app_label on the model's class Meta. So no patch would be needed.

 On the 2nd, it would be really easy to change the attached patch to fix
 the IndexError. But what would be the proper behavior? If the model isn't
 on the proper place, it would not crash, but wouldn't work either. How to
 proceed?

 I think at least we could have a specific exception message advising on
 setting the app_label to clear the obscurity. What do you think?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13903#comment:5>
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