#19421: When RelatedModel.__unicode__ fails, InlineModelAdmin are not displayed
-------------------------------+--------------------------------------
     Reporter:  benjaoming     |                    Owner:  nobody
         Type:  Bug            |                   Status:  closed
    Component:  contrib.admin  |                  Version:  1.4
     Severity:  Normal         |               Resolution:  worksforme
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  1              |                    UI/UX:  0
-------------------------------+--------------------------------------
Changes (by russellm):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 Can't reproduce. With models of
 {{{

 class Author(models.Model):
     name = models.CharField(max_length=100)

     def __unicode__(self):
         return u'Author called %s' % self.name


 class Book(models.Model):
     title = models.CharField(max_length=100)
     author = models.ForeignKey(Author)

     def __unicode__(self):
         return u'Book called %s' % self.invalid
 }}}
 and admin registration:
 {{{
 class BookInline(admin.TabularInline):
     model = Book

 class AuthorAdmin(admin.ModelAdmin):
     inlines = [BookInline]


 admin.site.register(Author, AuthorAdmin)
 }}}

 I get a full page exception, reading
 {{{
 AttributeError at /admin/testapp/author/1/
 'Book' object has no attribute 'invalid'
 }}}
 Which is exactly what I'd expect to see.

 If you can provide models that cause the error, feel free to reopen.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19421#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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to