#5373: Field label for a ForeignKey not translated
-------------------------------------+-------------------------------------
     Reporter:  Szilveszter Farkas   |                    Owner:  Fandekasp
  <szilveszter.farkas@…>             |                   Status:  new
         Type:  Bug                  |                  Version:  1.3
    Component:                       |               Resolution:
  Internationalization               |             Triage Stage:  Accepted
     Severity:  Normal               |      Needs documentation:  0
     Keywords:  i18n foreignkey      |  Patch needs improvement:  0
  field label                        |                    UI/UX:  0
    Has patch:  1                    |
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by claudep):

 * stage:  Ready for checkin => Accepted


Comment:

 There are several failures in the test suite with the patch applied. I
 realize now that until now, the foreign key label is not determined from
 the related model name, but from the current model attribute name. For
 example:
 {{{
 class Book(models.Model):
     ...

 class Article(models.Model):
    parent = ForeignKey(Book)
 }}}

 The label will be Parent, not Book. With the patch applied, the logic will
 change, which is clearly backward incompatible.

 I wonder in fact if this ticket should not simply be a won't fix, in that
 in the case of the original poster, the solution is simply to add a
 verbose_name attribute to the ForeignKey field. Even if it appears non-DRY
 when the field and the related model name are identical, we cannot assume
 that simply because the FK field has no verbose_name and there is a
 verbose_name on the related model, the user intends to use the related
 model name as label.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/5373#comment:29>
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