私はフォームを持っています:
class NewUserForm(forms.ModelForm):
first_name = forms.CharField(label=u'First name', required=True)
last_name = forms.CharField(label=u'Last name', required=True)
permissions = forms.ModelMultipleChoiceField(Permission.objects.none(), widget=forms.CheckboxSelectMultiple)
def __init__( self, *args, **kwargs ):
super( NewUserForm, self ).__init__( *args, **kwargs )
ctypes = ContentType.objects.filter(
Q(app_label='articles') |
Q(app_label='tags')
)
self.fields['permissions'].queryset = Permission.objects.filter(content_type__in=ctypes)
class Meta:
model = User
テンプレートのアクセス許可では、次のようなラベルが表示されます。
[] articles | article | Can change article
[] articles | article | Can delete article
[] articles | article | Can view article
[...]
このラベルを変更するには? (たとえば)「記事を変更できます」、おそらく他の言語でのみ取得したい。