#16978: Related models cannot have split() method
-------------------------------+--------------------
     Reporter:  mitar          |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Documentation  |    Version:  1.3
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 Related models cannot have `split()` method because `add_lazy_relation`
 (in `db/models/fields/related.py`) assumes that something with `split()`
 method must be string. I would propose that:

 {{{
         try:
             app_label, model_name = relation.split(".")
         except ValueError:
 }}}

 is changed to:

 {{{
         try:
             if isinstance(relation, ModelBase):
                 raise ValueError
             app_label, model_name = relation.split(".")
         except ValueError:
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16978>
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 this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to