我有形式:
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
[...]
如何更改此标签?我只想得到(例如):“可以更改文章”,也许是其他语言。