어떻게 번역 필드로 양식 필드의 옵션을 주문합니까?django-multilingual : 번역 필드별로 필드 드롭 다운 주문
models.py :
class UserProfile(models.Model):
...
country=models.ForeignKey('Country')
class Country(models.Model):
class Translation(multilingual.Translation):
name = models.CharField(max_length=60)
...
template.html :
{# userprofileform is a standard modelform for UserProfile #}
{{ userprofileform.country }}
당신을 감사
편집 :
나는 select
필드의 옵션이 원하는 name_de 또는 name_en으로 정렬 언어에 따라 :
<!-- English -->
<select>
<option>Afganistan</option>
<option>Austria</option>
<option>Bahamas</option>
</select>
<!-- German (as it is) -->
<select>
<option>Afganistan</option>
<option>Österreich</option>
<option>Bahamas</option>
</select>
<!-- German (as it should be) -->
<select>
<option>Afganistan</option>
<option>Bahamaas</option>
<option>Österreich</option>
</select>
더 구체적으로 말씀해 주시겠습니까? "다른 필드로 필드를 정렬"한다는 것은 정확히 무엇을 의미합니까? 예가 도움이 될 수 있습니다. – 3lectrologos
희망적입니다. – tback