On Thu, Jul 8, 2010 at 3:55 PM, Lachlan Musicman <data...@gmail.com> wrote:
> Hola,
>
> I'm new to this dev thing, but I've done some work on ticket #5373
>
> http://code.djangoproject.com/ticket/5373  Field label for a
> ForeignKey not translated

Thanks for pitching in! Hopefully I'll be able to give you enough
feedback to progress this issue without scaring you off :-)

> There are two different patches fixing the same problem - I've no idea
> which is considered better. I don't like the late import on the first
> patch (5373.2.patch), and the second may have unexpected consequences
> (5373_related.py.diff ).
>
> I've also added a patch for tests/regressiontests/admin_inlines that
> confirms that either patch works.

I agree that the first patch (.2.patch) isn't the right approach --
isinstance checks are generally an indication that you're doing
something wrong (or at least that you could be doing it better).

However, I'm also concerned about unexpected consequences for the
second patch. The obvious use case that you're breaking is if your
ForeignKey manually defines a verbose_name.

So - the next step is to make the tests more robust; you'll either
prove that this isn't a problem, or you'll find the edge case that
needs to be fixed.

As for the tests themselves; a general rule for testing is to test as
close to the source of the problem as possible. While I'm sure you
*can* observe this problem in the admin, the fact that the fix doesn't
involve any admin-specific code leads me to suspect that a better test
would be at a lower level -- in this case, testing that foreign key
fields return an appropriate verbose_name, and/or that ModelForms pick
up a translated verbose name.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to