#19401: 'swapped' checking does not account for case insensitivity
-------------------------------------+-------------------------------------
     Reporter:  chris@…              |                    Owner:  nobody
         Type:  Bug                  |                   Status:  reopened
    Component:  Database layer       |                  Version:
  (models, ORM)                      |  1.5-beta-1
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
    Has patch:  0                    |  Unreviewed
  Needs tests:  0                    |      Needs documentation:  0
Easy pickings:  0                    |  Patch needs improvement:  0
                                     |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by chriscog):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 Actually, this was something I only discovered myself, in that while app
 names are case sensitive, model names are not. Check out these lines from
 django/db/models/loading.py

 {{{
     def get_model(self, app_label, model_name,
                   seed_cache=True, only_installed=True):
         """
         Returns the model matching the given app_label and case-
 insensitive
         model_name.

         Returns None if no model is found.
         """
         if seed_cache:
             self._populate()
         if only_installed and app_label not in self.app_labels:
             return None
         return self.app_models.get(app_label,
 SortedDict()).get(model_name.lower())
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19401#comment:2>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to