KristianOellegaard/django-hvad — pull request #144 by spectras (2013-12-11 03:11:24+00:00)
Title: Fix: Fieldtranslator fails on proxy model related fields

Querying a proxy model and using one of its ForeignKey (and friends) fields is currently broken.
```python
class Normal(TranslatableModel):
shared_field = models.CharField(max_length=255)
translations = TranslatedFields(
translated_field = models.CharField(max_length=255)
)
class SimpleRelated(TranslatableModel):
normal = models.ForeignKey(Normal, related_name='simplerel')
translated_fields = TranslatedFields(
translated_field = models.CharField(max_length=255),
)
class SimpleRelatedProxy(SimpleRelated):
class Meta:
proxy = True

manager = get_translation_aware_manager(SimpleRelatedProxy)
manager.language('en').filter(normal__translated_field='English')
```
→ last line chokes as kwargs do not get translated, because fieldtranslator's *\_get_model_from_field* is flawed:
If the tuple returned by get_field_by_name has a non-none model, it uses it.
Now, this item in the tuple has nothing to do with relationships and should not be used this way.

This only bites when using an inherited field for referencing another model, which is why it may have gone unnoticed. Attached fix includes a testcase for this specific issue.