#27599: str(Field()) crashes
-------------------------------------+-------------------------------------
               Reporter:  Sergey     |          Owner:  nobody
  Fedoseev                           |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  1.8
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 {{{
 #!python
 In [1]: from django.db.models import Field

 In [2]: str(Field())
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)
 <ipython-input-2-4740ae05790d> in <module>()
 ----> 1 str(Field())

 /home/sergey/dev/django/django/utils/six.pyc in <lambda>(self)
     840                              klass.__name__)
     841         klass.__unicode__ = klass.__str__
 --> 842         klass.__str__ = lambda self:
 self.__unicode__().encode('utf-8')
     843     return klass
     844

 /home/sergey/dev/django/django/db/models/fields/__init__.pyc in
 __str__(self)
     188     def __str__(self):
     189         """ Return "app_label.model_label.field_name". """
 --> 190         model = self.model
     191         app = model._meta.app_label
     192         return '%s.%s.%s' % (app, model._meta.object_name,
 self.name)

 AttributeError: 'Field' object has no attribute 'model'
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27599>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.56de58afc7fd5fc616820052ba6f1378%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to